Module: LayoutsHelper

Defined in:
app/helpers/layouts_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_header_icon?(type) ⇒ Boolean

Returns:

  • (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_classObject

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