I'm currently looking at a piece of code from the excellent Rails-composer and I don't understand what the Embedded Ruby in the 3rd line does:
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
<a class="close" data-dismiss="alert">×</a>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
</div>
<% end %>
<% end %>
I've looked at the Ruby documentation with no luck so far. Once I understand how this code works I'd like to extend it to support all levels of flash[]
messages.