我有这个下拉列表:
- if current_user
%li.header__list-item.dropdown
%a.dropdown-toggle{:href => "#", "role" => "button", "data-toggle" => "dropdown", "data-target" => "#"}
Account
%b.caret
%ul.dropdown-menu{"role" => "menu"}
%li
= link_to "Change your password", edit_user_registration_path
%li
= link_to t('devisegeneral.sign_out'), destroy_user_session_path, method: :delete, class: 'header__link header__link--active'
- else
%li.header__list-item
= link_to t('devisegeneral.sign_in'), new_session_path(:user), class: 'header__link header__link--active'
,以便当用户单击Account
时,应该显示这两个链接change your password
和sign_out
。但是相反,我让它们都一直显示,并且“按钮”帐户不起作用。我缺少什么了吗,因为我浪费了很多时间,无法解决此问题。