我正在尝试使用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