- flash.each do |name, msg|
  - if msg.is_a?(String)
    %div{:class => "alert alert-#{name == :notice ? "success" : "danger"}"}
      %a.close{"data-dismiss" => "alert", "aria-hidden" => true} ×
      = content_tag :div, msg, :id => "flash_#{name}"

- flash.each do |name, msg|
  - if msg.is_a?(String) and msg.present?
    .alert.alert-dismissable{class: "alert-#{name == :notice ? "success" : "danger"}"}
      %button.close{'data-dismiss' => 'alert', 'aria-hidden' => true} &times;
      = content_tag :div, msg, :id => "flash_#{name}"

Fix flash message display issues
Fix flash message display issues