From 6c457c86ac3659797baaa18afd8d0edf1f51ebb1 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 4 Sep 2018 16:27:50 -0500 Subject: [PATCH] nav menu: fix 'Forum' link not getting '.current' class. Fixes the '.current' class not being set on the 'Forum' link when viewing the /forum_topics page. As a result, the link wasn't bolded and didn't have the background set. --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dc3483426..1632d9766 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,10 +8,10 @@ module ApplicationHelper end def nav_link_to(text, url, **options) + klass = options.delete(:class) + if nav_link_match(params[:controller], url) - klass = "current" - else - klass = nil + klass = "#{klass} current" end li_link_to(text, url, id_prefix: "nav-", class: klass, **options)