Module: FlashMessages::Display
- Defined in:
- lib/jquery/flash_messages.rb
Constant Summary collapse
- FLASH_NOTICE_KEYS =
end
[:error, :warning, :notice, :success]
Instance Method Summary collapse
Instance Method Details
#flash_messages ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/jquery/flash_messages.rb', line 27 def return unless = flash.keys.select { |k| FLASH_NOTICE_KEYS.include?(k) } = .map do |type| content_tag(:div, nil, :class => type.to_s + " ui-corner-all") do (flash[type], flash["#{type}_item".to_sym]) end end .join end |
#message_for_item(message, item = nil) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/jquery/flash_messages.rb', line 37 def (, item = nil) if item.is_a?(Array) content_tag(:div, nil, :class => :icon) + % link_to(*item) else content_tag(:div, nil, :class => :icon) + % item end end |