如图,系统左侧是导航栏,点击的栏位高亮,但是等跳转完,样式又回到默认的第一个栏位高亮。请问这个如何解决?
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-current_page-3F
<li><%= link_to "一键比对", contrast_path, class: ('active' if current_page?(contrast_path)) %></li>
params[:controller] == controller_name ? "active" : nil params[:action] == action_name ? "active" : nil