Module: FlashHelper
- Defined in:
- app/helpers/flash_helper.rb
Constant Summary collapse
- ALERT_TYPES =
[:error, :success, :warning]
Instance Method Summary collapse
Instance Method Details
#groundwork_flash ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/flash_helper.rb', line 4 def groundwork_flash = [] flash.each do |type, | next if .blank? type = :success if type == :notice type = :error if type == :alert next unless ALERT_TYPES.include?(type) Array().each do |msg| text = content_tag(:p, msg.html_safe, :class => "message #{type}") << text if end end .join("\n").html_safe end |