Sha256: 72009cf56c438229bfc40f122a12242ca617733b353aeac5b9cad39d483c037e

Contents?: true

Size: 606 Bytes

Versions: 5

Compression:

Stored size: 606 Bytes

Contents

module ActiveApplication
  module LayoutHelper
    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 << content_tag(: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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_application-0.3.1 app/helpers/active_application/layout_helper.rb
active_application-0.3.0 app/helpers/active_application/layout_helper.rb
active_application-0.2.0 app/helpers/active_application/layout_helper.rb
active_application-0.1.0 app/helpers/active_application/layout_helper.rb
active_application-0.0.1 app/helpers/active_application/layout_helper.rb