<% if flash.any? %>
<section class="flash">
  <% flash.each do |key, value| %>
    <%= check_box_tag key %>
    <%= content_tag(:article, class: key) do %>
      <%= content_tag(:p, value) %>
      <%= content_tag(:label, '&times;'.html_safe, for: key) %>
    <% end %>
  <% end %>
</section>
<% end %>

<% if flash.any? %>
<section class="flash">
  <%- flash.each do |key, value| %>
    <%= check_box_tag key %>
    <%= content_tag(:article, class: key) do %>
      <%= content_tag :ul do %>
        <%- Array(value).map do |message| %>
          <%= content_tag(:li, message) %>
        <%- end %>
      <%- end %>
      <%= content_tag(:label, '&times;'.html_safe, for: key) %>
    <%- end %>
  <%- end %>
</section>
<% end %>

Print out all flash messages instead of just an array
Print out all flash messages instead of just an array