Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Express 3.0 flash messages with view helper
// Expose the flash function to the view layer
app.use(function(req, res, next) {
res.locals.flash = function() { return req.flash() };

tj commented Jul 11, 2012

or res.locals.flash = req.flash.bind(req)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment