blog.robotex.de

Rails: display flash messages in your layout

Put following code in your layout (Rails.root/app/views/layout/application.html.erb) to show flash messages:

    <% flash.each do |key, value| %>
      <%= content_tag(:div, value, :class => "flash #{key}") %>
    <% end %> 

Back