i am quite new to expressjs/nodejs and trying to pass multiple values from a route to a view so that i am able to show user specific input on the page. This is what i have in my route:
// Dashboard for site after the login
app.get('/dashboard', function(req, res) {
res.render('dashboard.jade', {
title: 'Dashboard',
user: app.get('user_name')
});
});
I have stored the user name in app.get('user_name'). if i replace it with a normal string like 'test string' than it works. but if i use this app.get function nothing is getting passed to the view.
thanks
Try using app.locals documented here: http://expressjs.com/api.html#app.locals