[Rails] devise introduction method

What is devise

--One of the gems (libraries) that can easily implement the authentication function in applications created with Rails. --You can create login functions such as login and sign-up.

Introduction method

① Add to Gemfile

Gemfile


gem 'devise'

② Execute bundle install

Terminal


$ bundle install

③ Create a configuration file

Terminal


$ rails g devise:install

Newly created file


config/initializers/devise.rb
config/locales/devise.en.yml

④ Create a User model with devise function

Terminal


$ rails g devise user

Newly created file


app/models/user.rb
db/migrate/20XXXXXXXXXXXX_devise_create_users.rb
test/fixtures/users.yml
test/models/user_test.rb

⑤ Create a devise view file

Terminal


$ rails g devise:views

Newly created file


app/views/devise #Various view files in the following directories

This completes the devise installation

Recommended Posts

[Rails] devise introduction method
[Rails] devise helper method
[Rails] Introduction of devise Basics
[Rails] devise
rails method
Rails delegate method
[Rails 6] cocoon_ introduction
[Rails] Introducing devise
[Rails] Introduction of PAY.JP
Handle devise with Rails
[rails] About devise defaults
What is Rails gem devise?
[Rails] gem devise installation flow
[Rails] require method and permit method
(For beginners) [Rails] Install Devise
[Rails] Add column to devise
[rails] error during devise installation
About Rails scraping method Mechanize
I was addicted to setting default_url_options with Rails devise introduction
[Rails] How to use gem "devise"
[Rails] How to use devise (Note)
[Rails] Session timeout setting in devise
[Rails] Introduction of Rubocop by beginners
[rails] Login screen implementation in devise
[Devise] rails memo basic setting initial setting
Rails book review app RSpec introduction
Introduction to algorithms with java-Shakutori method
[Rails] [Devise] Edit profile without password
[Rails] About helper method form_with [Basic]
Ruby On Rails devise routing conflict
[Rails] Add strong parameters to devise
[Rails 6] destroy using the resources method
Create My Page with Rails devise
[Ruby on Rails] Convenient helper method
[Introduction to Rails] How to use render
[Rails] Manage multiple models using devise gem
[Ruby on Rails] Introduction of initial data
[Rails] Function restrictions in devise (login / logout)
Rails enum Select prefecture by pull-down method
Rails 5 Code Reading Part 1 ~ ActiveRecord new Method ~
[Rails] How to use the map method
[Note] How to use Rails 6 Devise + cancancan
[Rails] Method summary for conversion / verification / search
[Rails] How to use helper method, confimartion
[Rails] How to translate devise into Japanese