Refactor active_nav_class for use with multiple paths (#8757)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user