require 'action_view/helpers' module FoundationRailsHelper module FlashHelper #
# This is a success alert (div.alert-box.success). # × #
KEY_MATCHING = { :notice => :success, :info => :warning, :failure => :error, :alert => :error, } def display_flash flash.inject "" do |message, (key, value)| message += content_tag :div, :class => "alert-box #{KEY_MATCHING[key] || key}" do (value + link_to("×".html_safe, "#", :class => :close)).html_safe end end.html_safe end end end