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.
This commit is contained in:
evazion
2018-09-04 16:27:50 -05:00
parent 5c457fbe51
commit 6c457c86ac

View File

@@ -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)