Module: ActiveApplication::LayoutHelper

Defined in:
app/helpers/active_application/layout_helper.rb

Instance Method Summary collapse

Instance Method Details

#layout_flashObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/active_application/layout_helper.rb', line 3

def layout_flash
  html = Array.new
  flash.each do |key, msg|
    case key.to_s
    when "alert"
      flash_class = "alert-error"
    when "notice"
      flash_class = "alert-info"
    else
      flash_class = key.to_s
    end
    html << (:div,
      msg.html_safe + ' <a class="close" href="#" data-dismiss="alert">&times;</a>'.html_safe,
      class: ["fade", "in", "alert", flash_class],
      "data-alert" => "alert"
    )
  end
  html.join.html_safe
end