Module: Appoxy::UI::ApplicationHelper
- Defined in:
- lib/ui/application_helper.rb
Constant Summary collapse
- FLASH_NAMES =
[:error, :info, :success, :warning, :validation]
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/ui/application_helper.rb', line 7 def self.included(base) puts self.class.name + " included in " + base.class.name end |
Instance Method Details
#flash_messages ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/ui/application_helper.rb', line 13 def return unless = flash.keys.select{|k| FLASH_NAMES.include?(k)} = .map do |type| content_tag :div, :class => type.to_s do (flash[type], flash["#{type}_item".to_sym]) end end .join end |
#message_for_item(message, item = nil) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/ui/application_helper.rb', line 24 def (, item = nil) if item.is_a?(Array) % link_to(*item) else % item end end |