#18 Looping Through Flash

Displaying flash messages in the layout can be a pain at times. In this episode you will learn an easy way to display any kind of flash message by looping through the hash.
<!-- layouts/application.rhtml -->
<% flash.each do |key, msg| %>
  <%= content_tag :div, msg, :id => key %>
<% end %>

你可能感兴趣的:(java,Flash)