Problem in accessing flash
messages
on view in node.js
In my Controller
this.req.flash('info','successfully submited');
this.redirect("/home");
In my home view I am not able to get flash
messages
as
req.flash('info');
EDIT In controller
self.req.flash('message','hello');
In view
<%= req.flash('message) %>
In server.js
app.configure(function (){
app.use(express.cookieParser());
app.use(express.session({ secret:'yoursecret',cookie: { maxAge: 24 * 60 * 60 * 1000 }}));
app.use(passport.initialize());
app.use(locomotive.session());
app.use(flash());
app.use(passport.session());
app.use(app.router);
app.dynamicHelpers({ messages: require('express-messages') });
});
I have the locomotive framework.
Please see tempdata example https://github.com/MKxDev/TempData