Devise
Add devise gem
$ bundle add deviseAdd devise to project and follow instruction in terminal
$ rails g devise:installCreate a model
model is normally user or admin
$ rails g devise Modelnew model now contains 1) etc 2) etc 3) etc
then run $ rails db:migrate to update database
Views for the user are being run in the background to have control over these views and add them to the project run
$ rails g devise:viewsWorking with the user
set up a controller with user authentication.Add this to controller
before_action :authenticate_user!