diff options
author | ThibG <thib@sitedethib.com> | 2018-09-23 20:42:13 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-23 20:42:13 +0200 |
commit | c39183cc628ea9556db53af5059656d6b63609ba (patch) | |
tree | 27e79ae58e4f5e1192a9ec638220f44fd71587fa /app/helpers | |
parent | d0d65b5a2899546c4134d1fca60aef2c23c4932d (diff) |
Refactor active_nav_class for use with multiple paths (#8757)
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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) |