我正在嘗試使用user_signed_in?到登錄區域添加到我的軌道使用3個應用程序設計1.1.3,我得到一個NoMethodErrorin規則#指數設計:NoMethod錯誤&user_signed_in
<% if user_signed_in? -%>
<div id="user_login_box" style="float:right">
<%= current_user.email %> |
<%= link_to 'My info', edit_user_registration_path %> |
<%= link_to 'Sign out', destroy_user_session_path %>
</div>
<% end -%>
我不知道什麼是錯的究竟,但顯然沒有被使用的色器件的方法。我也相當(閱讀:真的)新的鐵軌,並沒有用過之前的設計。
如果你刪除'user_signed_in?'並登錄,並進入顯示你提到的視圖的頁面,是否顯示了<%= current_user.email%>? – Zabba 2010-11-07 04:44:59
不是。我得到這個: 未定義的局部變量或方法'current_user'爲#<#:0xab962d4> –
SpaceGhost
2010-11-07 05:08:48