Module: BootstrapFlashHelper
- Defined in:
- app/helpers/bootstrap_flash_helper.rb
Constant Summary collapse
- ALERT_TYPES =
[:error, :info, :success, :warning]
Instance Method Summary collapse
Instance Method Details
#bootstrap_flash ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/bootstrap_flash_helper.rb', line 4 def bootstrap_flash output = '' flash.each do |type, | next if .blank? type = :success if type == :notice type = :error if type == :alert next unless ALERT_TYPES.include?(type) output += flash_container(type, ) end raw(output) end |
#flash_container(type, message) ⇒ Object
17 18 19 20 21 22 |
# File 'app/helpers/bootstrap_flash_helper.rb', line 17 def flash_container(type, ) raw(content_tag(:div, :class => "alert alert-#{type}") do content_tag(:a, raw("×"),:class => 'close', :data => {:dismiss => 'alert'}) + end) end |