Module: LayoutsHelper
- Defined in:
- app/helpers/layouts_helper.rb
Instance Method Summary collapse
- #current_header_icon?(type) ⇒ Boolean
- #current_header_icon_class(type) ⇒ Object
-
#header_logo_class ⇒ Object
Sets “out” class to header_signed_out in frontpage and devise’s controllers and “in” class in the rest of the application.
Instance Method Details
#current_header_icon?(type) ⇒ Boolean
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/helpers/layouts_helper.rb', line 6 def current_header_icon? type controllers = case type when :home 'home' when :contacts 'contacts' when :events 'events' when :resources 'repositories' when :messages [ 'messages', 'conversations' ] end Array.wrap(controllers).include? controller.controller_name end |
#current_header_icon_class(type) ⇒ Object
2 3 4 |
# File 'app/helpers/layouts_helper.rb', line 2 def current_header_icon_class type current_header_icon?(type) ? 'active' : '' end |
#header_logo_class ⇒ Object
Sets “out” class to header_signed_out in frontpage and devise’s controllers and “in” class in the rest of the application
26 27 28 29 30 |
# File 'app/helpers/layouts_helper.rb', line 26 def header_logo_class controller.controller_path =~ /frontpage|devise/ ? 'out' : 'in' end |