title: how do i fix routes to find views inside subfolders in node.js
body: <p>i am trying to create a route for localhost:port/admin/
  and i want to keep the routes.js files and view.js files in matching folders so i wont have too much spaggeti later on</p>
  
  <p>but i keep getting: 500 Error: Failed to lookup view "/admin/manage_subjects"
  for trying to create a new route and using same folders few the same</p>
  
  <p>i have the following view folder with express</p>
  
  <pre><code>mainapp(root)
    routes(folder)
      admin(folder)
        index.js(nested inside admin)
      index.js(nested inside routes)
    views(folder)
      admin(folder)
        admin_layout.jade(nested inside admin)
        manage_subjects.jade(nested inside admin)
      index.jade(nested inside views)
      layout.jade(nested inside views)
  </code></pre>
  
  <p>code:
  routes/admin/index.js</p>
  
  <pre><code>exports.index = function (req, res) {
  res.render('manage_subjects',{title:'Express'});}
  </code></pre>
  
  <p>views/admin/manage_subjects.jade</p>
  
  <pre><code>extends admin_layout
  block content
  h1 = title
  p Welcome to #{title}
  </code></pre>
  
  <p>my app.js code</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
    , admin_routes = require('./routes/admin/')
    , user = require('./routes/user')
    , http = require('http')
    , path = require('path')
    , repository = new (require('./domain_model/repository'))();
  
  var app = express();
  
  // all environments
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
  
  // development only
  if ('development' == app.get('env')) {
    app.use(express.errorHandler());
  }
  
  //fill local subjects
  repository.subjects.GetAll(function (err, data) {
      if (err) throw err;
      app.locals.subjects = data;
  });
  
  //append routes
  app.get('/', routes.index);
  app.get('/admin', admin_routes.index);
  app.get('/users', user.list);
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on http://localhost:' + app.get('port'));
  });
  </code></pre>