Following is the code in config/routes.js file
module.exports = function(app) {
app.get('/', function(req, res) {
res.render('login/login.jade', {
layout : 'layouts/login.jade',
title : 'Express'
});
});
};
Basically what I am trying is to render views/login/login.jade within views/layouts/login.jade.
But the path that express.js looks for to find the layout file is relative to views/login
Following is the error I get.
**failed to locate view "layouts/login.jade", tried:
- ../msf_showcase_exp/views/login/layouts/login.jade
- ../msf_showcase_exp/views/login/../msf_showcase_exp/views/layouts/login.jade**
Is the anyway to specify in Express.js to search for the layout in views/layout. ?
this should work. just tried it (with node 0.4.11, express 2.4.6 and jade 0.15.4)
folders look like this
in app.js:
in router.js