This is Qiita's first post. I'm sorry for the poor text, but I hope you can read it. Thank you.
Gemfile
#abridgement
gem 'devise' #Please add to the last line
bundle install
in the terminalTerminal
$ bundle install
devise
is installed with Gemfile.lockGemfile.lock
#abridgement
devise
After the installation is complete, create a configuration file using the devise-specific command.
rails g devise: install
in the terminalTerminal
#Create devise config file
$ rails g devise:install
** Newly created file **
config/locales/devise.en.yml
rails g devise user
in the terminalTerminal
#Create a model with the devise command
$ rails g devise user
** Newly created file **
test/models/user_test.rb
Also, the description of devise_for: users
is automatically added to config / routes.rb.
config/routes.rb
Rails.application.routes.draw do
devise_for :users
#abridgement
rails db: migrate
in the terminalTerminal
#Execute the created migration file
$ rails db:migrate
rails g devise: views
in your terminalTerminal
#Create a view for devise
$ rails g devise:views
** Newly created file **
app/views/devise/mailer/unlock_instructions.html.erb
So far, I have explained the flow when installing gem devise
.
I hope it will be helpful to as many people as possible.
Recommended Posts