我有一个导航面板。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.