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 faced same requirement and here is my solution.
Create a method within ApplicationHelper
ApplicationHelper
def active_class(link_path) current_page?(link_path) ? "active" : "" end
And inside your view:
<%= link_to 'HOME', root_path %>