Sha256: 3fa1dc1fe864c92bbc4d9ced9d19b781df17fcd96afaa48fffd319d1fe4441f6

Contents?: true

Size: 474 Bytes

Versions: 2

Compression:

Stored size: 474 Bytes

Contents

module BootstrapFlashHelper  
  def bootstrap_flash
   flash_messages = []
   flash.each do |type, message|
     type = :success if type == :notice
     type = :error   if type == :alert
     text = content_tag(:div, 
              content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") +
              message, :class => "alert fade in alert-#{type}")
     flash_messages << text if message
   end
   flash_messages.join("\n").html_safe
 end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
twitter-bootstrap-rails-2.1.4 app/helpers/bootstrap_flash_helper.rb
twitter-bootstrap-turbo-2.1.3 app/helpers/bootstrap_flash_helper.rb