Module: HomePage::ApplicationHelper
- Defined in:
- app/helpers/home_page/application_helper.rb
Instance Method Summary collapse
-
#bootstrap_flash_raw ⇒ Object
Taken from github.com/seyhunak/twitter-bootstrap-rails Modified to support html in flash message.
Instance Method Details
#bootstrap_flash_raw ⇒ Object
Taken from github.com/seyhunak/twitter-bootstrap-rails Modified to support html in flash message
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/home_page/application_helper.rb', line 5 def bootstrap_flash_raw = [] flash.each do |type, | flash.delete(type) # Skip Devise :timeout and :timedout flags next if type == :timeout next if type == :timedout content = type.to_s == "filter" ? "" : content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") type = :success if ["notice", "filter"].include? type.to_s type = :danger if ["alert", "error", "recaptcha_error"].include? type.to_s content += raw() text = content_tag(:div, content, :class => "alert fade in alert-#{type}") << text if end .join("\n").html_safe end |