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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user