Changing Current Tab in Rails

后端 未结 8 1064
北荒
北荒 2020-12-28 10:05

I have a list of tabs at the top of my application that I include in a general layout in application.html.erb. They look like this:

  • 8条回答
    •  轮回少年
      2020-12-28 10:30

      You could try something like:

    • <%= link_to "Home", provider_path(current_user.id), :method=> "GET"%>
    • <%= link_to "Edit Profile", edit_student_path(current_user.id) %>
    • <%= link_to "Search", provider_search_path %>
    • ...and just check which controller you're coming from.

    提交回复
    热议问题