Module: FoundationRailsHelper::FlashHelper
- Defined in:
- lib/foundation_rails_helper/flash_helper.rb
Constant Summary collapse
- DEFAULT_KEY_MATCHING =
<div class=“alert-box [success alert secondary]”>
This is an alert box. <a href="" class="close">×</a></div>
{ alert: :alert, notice: :success, info: :info, secondary: :secondary, success: :success, error: :alert, warning: :warning }.freeze
Instance Method Summary collapse
Instance Method Details
#display_flash_messages(key_matching = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/foundation_rails_helper/flash_helper.rb', line 18 def (key_matching = {}) key_matching = DEFAULT_KEY_MATCHING.merge(key_matching) key_matching.default = :standard capture do flash.each do |key, value| next if FoundationRailsHelper.configuration.ignored_flash_keys.include? key.to_sym alert_class = key_matching[key.to_sym] concat alert_box(value, alert_class) end end end |