Sha256: e3560cda6508bfa6adbc7c9f2e88a75ee35b8e05031f875cd3d69472f1ef5a5c
Contents?: true
Size: 804 Bytes
Versions: 1
Compression:
Stored size: 804 Bytes
Contents
require 'action_view/helpers' module FoundationRailsHelper module FlashHelper # <div class="alert-box [success alert secondary]"> # This is an alert box. # <a href="" class="close">×</a> # </div> DEFAULT_KEY_MATCHING = { :alert => :alert, :notice => :success, :info => :standard, :secondary => :secondary, } def display_flash_messages(key_matching = {}) key_matching = DEFAULT_KEY_MATCHING.merge(key_matching) flash.inject "" do |message, (key, value)| message += content_tag :div, :data => { :alert => "" }, :class => "alert-box #{key_matching[key] || :standard}" do (value + link_to("×".html_safe, "#", :class => :close)).html_safe end end.html_safe end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
foundation_rails_helper-0.4 | lib/foundation_rails_helper/flash_helper.rb |