Skip to content

undefined method `user_signed_in?' for #4

@rancesvinto

Description

@rancesvinto

Hi,

I'm trying to create a link in layouts/application.html.erb to login/logout/register but i found this problem:

ActionView::Template::Error (undefined method `user_signed_in?' for #<#Class:0xb55a3d8:0xb5594b0>):
9:
10:
11:


12: <% if user_signed_in? %>
13: Signed in as <%= current_user.email %>. Not you?
14: <%= link_to "Sign out", destroy_user_session_path %>
15: <% else %>

Have anybody found same problem?

The code in application.html.erb is just:

<% if user_signed_in? %> Signed in as <%= current_user.email %>. Not you? <%= link_to "Sign out", destroy_user_session_path %> <% else %> <%= link_to "Sign up", new_user_registration_path %> or <%= link_to "Sign in", new_user_session_path %> <% end %>

Many thanks!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions