Changing current tab in Rails
You can use controller.class == and controller.action_name == to figure out exactly which controller and action you are on
so it would be something like:
<%= controller.class == ProviderController and controller.action_name == 'show' ? 'current' : '' %>"><%= link_to "Home",provider_path(current_user.id), :method=> "GET"%>
<%= controller.class == StudentController and controller.action_name == 'edit' ? 'current' : '' %>"><%= link_to "Edit Profile", edit_student_path(current_user.id) %>
<%= controller.class == ProviderController and controller.action_name == 'search' ? 'current' : '' %>"><%= link_to"Search", provider_search_path %>
You can use controller.class == and controller.action_name == to figure out exactly which controller and action you are on
so it would be something like:
<%= controller.class == ProviderController and controller.action_name == 'show' ? 'current' : '' %>"><%= link_to "Home",provider_path(current_user.id), :method=> "GET"%>
<%= controller.class == StudentController and controller.action_name == 'edit' ? 'current' : '' %>"><%= link_to "Edit Profile", edit_student_path(current_user.id) %>
<%= controller.class == ProviderController and controller.action_name == 'search' ? 'current' : '' %>"><%= link_to"Search", provider_search_path %>