User_signed_in? doesnt work
Whenever I request for a user_signed_in?' I get a "undefined method
user_signed_in?' for #<#Class:0x0000558f3526b730:0x0000558f352697c8>" error code. The code changes everytime. Im trying to check if the user is logged in to change a "Log In" into a "Log Out" and neither `user_signed_in?' not account_signed_in? works. Please help
It would certainly help if you'd provide some of the actual code. The error you're having is that the method user_signed_in?
does not exist.
Here are some points I'd suggest you check:
- what is the Devise resource? is it setup correctly? did you run the generators
- check
routes.rb
for something likedevise_for :users
- if it's not there then the Devise setup is missing - try running
bundle install
and restarting your server (if you haven't already) - check that you call
before_action :authenticate_user!
(typically from yourApplicationController