This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add in application helper for bootstrap_flash | |
module ApplicationHelper | |
ALERT_TYPES = [:error, :info, :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(:div, | |
content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") + | |
msg.html_safe, :class => "alert fade in alert-#{type}") | |
flash_messages << text if msg | |
end | |
end | |
flash_messages.join("\n").html_safe | |
end | |
end | |
#Add to Gem file | |
gem "sass-rails", "~> 4.0.0" | |
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails', | |
:github => 'anjlab/bootstrap-rails', | |
:branch => '3.0.0' | |
rake assets:precompile |
No comments:
Post a Comment