in my user edit page, there is a line as follows:
<%= devise_error_messages! %>
The problem is this does not output errors the standard way that the rest of the app does:
<% flash.each do |key, value| %>
<div class="flash <%= key %>"><%= value %></div>
<% end %>
My question is, how do I get the devise error message to work like the others that use the flash.each?
Thanks.
I came up to this and it's working so far. That adds devise messages to the flash, so it can be used as usual. Please consider that I'm new to Ruby and Rails...
Edit:
Sorry I was running guard and some unwanted behavior was present. Since
after_filter
is called after the rendering so it doesn't work as expected. If someone know how to call a method after the action but before the rendering...But you can use something like that instead:
In
views/shared/_messages.html.erb
i simply do this, worked for me: in app/helpers/, i create a file devise_helper.rb
in all view files i change
for:
for me it make in my view edit and new user:
hope it will help you ;)