You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a particular page, I want to have a flash for both success and error messages. However, I cannot figure out how to determine which is which in the view template:
In your handler you specify the object to create that message variable that you send to the view. Like so:
...
response.render('view', {message:{success: request.flash('success'),error: request.flash('error')}});
Makes for some extra work because in your view you have to check if the array is empty. Doing it the above suggested way, if you don't have any success type errors you will still get
On a particular page, I want to have a flash for both success and error messages. However, I cannot figure out how to determine which is which in the view template:
How to access the message in the view:
<%= message %>
But I'm not seeing any way to do this? Is this possible?
The text was updated successfully, but these errors were encountered: