Refactor active_nav_class for use with multiple paths (#8757)
This commit is contained in:
parent
d0d65b5a28
commit
c39183cc62
3 changed files with 11 additions and 3 deletions
|
@ -7,8 +7,8 @@ module ApplicationHelper
|
|||
follow
|
||||
).freeze
|
||||
|
||||
def active_nav_class(path)
|
||||
current_page?(path) ? 'active' : ''
|
||||
def active_nav_class(*paths)
|
||||
paths.any? { |path| current_page?(path) } ? 'active' : ''
|
||||
end
|
||||
|
||||
def active_link_to(label, path, **options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue