Module: LayMeOut::ApplicationHelper
- Defined in:
- app/helpers/lay_me_out/application_helper.rb
Instance Method Summary collapse
- #content_class ⇒ Object
- #convert_flash_to_json ⇒ Object
- #css_active_class_for(path) ⇒ Object
- #render_navigation ⇒ Object
- #render_user_profile ⇒ Object
Instance Method Details
#content_class ⇒ Object
26 27 28 |
# File 'app/helpers/lay_me_out/application_helper.rb', line 26 def content_class content_for?(:side_menu) ? "two-column" : "one-column" end |
#convert_flash_to_json ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/helpers/lay_me_out/application_helper.rb', line 30 def convert_flash_to_json = [] flash.each do |key, values| values = [values] unless values.is_a?(Array) values.each do |value| << { :content => value, :type => key } end end .to_json end |
#css_active_class_for(path) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/lay_me_out/application_helper.rb', line 11 def css_active_class_for(path) is_active = false if path.is_a? Hash path.each do |key, subpath| is_active = controller.active_page?(subpath) break if is_active end else is_active = controller.active_page?(path) end is_active ? "active" : "" end |
#render_navigation ⇒ Object
7 8 9 |
# File 'app/helpers/lay_me_out/application_helper.rb', line 7 def render :partial => 'lay_me_out/common/navigation', :locals => { :links => controller. } if has_value_for?(:navigation_links) end |
#render_user_profile ⇒ Object
3 4 5 |
# File 'app/helpers/lay_me_out/application_helper.rb', line 3 def render_user_profile render :partial => "lay_me_out/common/user_profile", :locals => { :user => controller.current_user_details } if has_value_for?(:current_user_details) end |