Rails devise: user_signed_in? not working

后端 未结 6 2183
终归单人心
终归单人心 2020-12-03 14:21

I have this in my view:

<% if user_signed_in? %>
<%= current_user.email %>
<% else %>
<%= link_to \"Sign in\", new_user_session_path %&g         


        
6条回答
  •  时光说笑
    2020-12-03 14:43

    Make sure that you are using the right model. For example if your model is member then you should use member_sign_in instead of user_sign_in.

提交回复
热议问题