On Wed, Sep 22, 2010 at 9:35 AM, radhames brito <[email protected]> wrote:
> add this
>
> <% flash.each do |name, msg| %>
> <%= content_tag :div, msg, :id => "flash_#{name}" %>
> <% end %>
> it will loop the flash to see if there is any kind of message and create a
> corresponding div
Thanks so much! That solved it!
and tundrax's point to look at configuring controllers helped where it says:
"Remember that Devise uses flash messages to let users know if sign in
was successful or failed. Devise expects your application to call
"flash[:notice]" and "flash[:alert]" as appropriate. "
(Sorry I hadn't looked there since didn't think it was related to that section.)
In my application layout I had:
<%= flash[:notice] %>
but I did not have
<%= flash[:alert] %>
adding radhames' loop, or the flash alert, solves it.
I take it the loop is better approach since it will work for any type
of flash message - notice or alert?
--
Rick R
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.