I will summarize what I learned and stumbled on every day. If you find any mistakes, please let us know! I’m always helped by other people’s articles, so I hope it helps.
What kind of error
Error that user_signed_in helper method is not defined, which can be used with devise.
What happens when
- When devise is not installed.
- When there is no description such as devise_for :users in routes.rb.
1. Describe the following in the Gemfile.
Run the following in the terminal:
Create configuration file
rails g devise:install
Create a model corresponding to the login function
rails g devise user
Create table related to login function
bundle exec rake db:migrate
2. Write the following in routes.rb