我有一個導航面板。如果我點擊它,我想要菜單項的類更改爲active
。我不能更改標記類
%li= { :class => current_page?(admin_roles_path) ? 'active' : nil }
= link_to "Roles", admin_roles_path
,但我得到了以下錯誤:
Haml::SyntaxError in Admin::Roles#index
Showing /sites/freshapp/app/views/layouts/_sidebar.html.haml where line #7 raised:
Illegal nesting: content can't be both given on the same line as %li and nested within it.
是的,是的,謝謝你,我也發現了:)。 – ramkhat