Basically, I have a lot of code that looks like this:
link_to t(\'.profile\'), business_path(@business), class: \'#{\'active\' if current_page? business_path(@bu
I did the same that @egyamado. I needed to use AwesomeIcons too, so:
A helper:
def active_class?(link_path)
'active' if current_page?(link_path)
end
And it was my view:
<%= link_to my_controller_page_path,
:title => "My Controller Page",
:class => "other_name_class #{active_class?(my_controller_page_path)}" do %>
My Controller Page
<%end%>
In another kind of Link, for example inside a Li.
#In this case I put a extra validation in root_path
It worked for me.