当用户在 root_path 上时,我想添加一个 css 类:登陆页面。我正在使用haml。
%body
={:class => "landing-page" if current_page?(root_path)}
我收到语法错误,关于这实际上应该如何的任何想法?
更新: 我这样做了,它对我有用:
%body{:class => "normal-page#{current_page?(root_path) ? 'landing-page' : ''}"}
当用户在 root_path 上时,我想添加一个 css 类:登陆页面。我正在使用haml。
%body
={:class => "landing-page" if current_page?(root_path)}
我收到语法错误,关于这实际上应该如何的任何想法?
更新: 我这样做了,它对我有用:
%body{:class => "normal-page#{current_page?(root_path) ? 'landing-page' : ''}"}