Module: LeftSide::Rails::Helper
- Defined in:
- lib/left_side/helper.rb
Instance Method Summary collapse
- #live_active?(link, active_class = "active") ⇒ Boolean
- #live_active_helper?(link, active_class) ⇒ Boolean
Instance Method Details
#live_active?(link, active_class = "active") ⇒ 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
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 |