From c39183cc628ea9556db53af5059656d6b63609ba Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 23 Sep 2018 20:42:13 +0200 Subject: Refactor active_nav_class for use with multiple paths (#8757) --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 758f864d7..f8e2c0e11 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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) -- cgit