I am using devise as well as ldap in my application to authenticate users. I have got the users model set up as well as devise. I can properly sign in and sign out users but I cannot access any information for the devise built in helper; current_user.
I want the main page of the application to show the current users name at the top of the page. I have created the column in the users table called display_name.
This is the code that I want to work:
<% if user_signed_in? %>
<div> <%= current_user.display_name %> </div>
<% end %>
When I used byebug and try to access the current user it returns nil.
Does anyone have any suggestions on how I can access the current users information?
Update
I tried using: <% if signed_in %>
but i still get the same error: undefined method `display_name' for nil:NilClass