Module: LeftSide::Rails::Helper

Defined in:
lib/left_side/helper.rb

Instance Method Summary collapse

Instance Method Details

#live_active?(link, active_class = "active") ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/left_side/helper.rb', line 8

def live_active?(link, active_class = "active")
  Array(link).inject(nil){|s, lin| s ||= live_active_helper?(lin, active_class)}
end

#live_active_helper?(link, active_class) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/left_side/helper.rb', line 12

def live_active_helper?(link, active_class)
  url_match?(link) ? active_class : nil
end