Changing Current Tab in Rails

后端 未结 8 1070
北荒
北荒 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:33

      You could just do this:

      <%= current_page?(:controller => 'your_controller', :action => 'index') ? 'current' : '' %>
      

    提交回复
    热议问题