Sha256: b00689602e6c57a7f04b89cdefecf4f2cf62b9148f2b5cf567268f7a4a874304

Contents?: true

Size: 565 Bytes

Versions: 11

Compression:

Stored size: 565 Bytes

Contents

module GroundworkFlashHelper
  ALERT_TYPES = [:error, :success, :warning]

  def bootstrap_flash
    flash_messages = []
    flash.each do |type, message|
      next if message.blank?
      
      type = :success if type == :notice
      type = :error   if type == :alert
      next unless ALERT_TYPES.include?(type)

      Array(message).each do |msg|
        text = content_tag(:p,
                           msg.html_safe, :class => "message #{type}")
        flash_messages << text if message
      end
    end
    flash_messages.join("\n").html_safe
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
groundworkcss-rails-0.2.12 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.11 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.10 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.9 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.8 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.7 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.6 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.5 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2.2 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.2 app/helpers/groundwork_flash_helper.rb~
groundworkcss-rails-0.1 app/helpers/groundwork_flash_helper.rb~