[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 6] cocoon_ introduction
[Rails] Introducing devise
rails + devise + devise_token_auth
[Rails] Customize devise validation
[Rails] Introduction of PAY.JP
Handle devise with Rails
[rails] About devise defaults
[rails] How to use devise helper method before_action: authenticate_user!
What is Rails gem devise?
[Rails] gem devise installation flow
about the where method (rails)
[Rails] require method and permit method
[Rails] How to install devise
Rails "render method" and "redirect method"
[Rails] Add column to devise
[rails] error during devise installation
About Rails scraping method Mechanize
Memorandum [Rails] User authentication Devise
Introduction to RSpec-Everyday Rails Summary-
I was addicted to setting default_url_options with Rails devise introduction
Method
[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
NoMethodError: undefined method `setup'for Devise: Module
[Rails] Unexpected validation error in devise
Rails book review app RSpec introduction
Introduction to algorithms with java-Shakutori method
[Rails] RSpec Kihon no Ki [Introduction]
[Rails] About helper method form_with [Basic]
[Rails] Add strong parameters to devise
[Rails 6] destroy using the resources method
[Introduction to Rails] form_with (local: true)
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 ~
Ruby on Rails installation method [Mac edition]
[Rails] How to use the map method
Rails g devise: install cannot be executed!
[Note] How to use Rails 6 Devise + cancancan
[Rails] Method summary for conversion / verification / search
[Rails] How to use helper method, confimartion
[Vue.js] Implementation of menu function Vue.js introduction rails6
[Rails] How to translate devise into Japanese