[RUBY] Implementation of user authentication function using devise (1)

This time, I will write about how to implement the user authentication function using devise.

To be able to

·user registration ・ Login ・ Log out

This is an essential function for Web services. Let's go fast.


First at the bottom of the Gemfile in the rails application directory

Gemfile


gem 'devise'

It is described as. Then at the terminal

% bundle install

to hold. Since it is necessary to restart the server after bundle install

% rails s

to hold.


Then to install the devise config file into the rails application

% rails g devise:install 

to hold. This command will automatically generate the files used for devise settings.


Next, create a model that manages users. The command is different from the normal model creation procedure.

% rails g devise user

Let's execute. This will generate the model and migration files for devise.


Next, let's add the necessary columns to the generated migration file.

Once you have filled in the required columns, at the terminal

% rails db:create

Create a database with

% rails db:migrate

Let's migrate with.

This completes the creation of the User model for the time being.

Continue to (2).

Recommended Posts

Implementation of user authentication function using devise (2)
Implementation of user authentication function using devise (1)
Implementation of user authentication function using devise (3)
Creating a user authentication function using devise
[Rails] Implementation of user withdrawal function
[Rails] Implementation of new registration function in wizard format using devise
[Implementation procedure] Create a user authentication function using sorcery in Rails
Implementation of search function
Implementation of pagination function
Introduction of user authentication
[Rails] Implementation of search function using gem's ransack
[Rails 6] Implementation of inquiry function using Action Mailer
Implement user edit / update function without using devise
[Rails] Implementation of image enlargement function using lightbox2
[Note] Summary of rails login function using devise ①
Implementation of Ruby on Rails login function (devise edition)
Implementation of sequential search function
Implementation of like function (Ajax)
[Rails 6] Implementation of search function
Implementation of image preview function
[Rails] Implementation of multi-layer category function using ancestry "Preparation"
[Rails] Implementation of category function
[Rails] Implementation of multi-layer category function using ancestry "seed"
Implementation of category pull-down function
[Rails] Implementation of tutorial function
[Rails] Implementation of SNS authentication (Twitter, Facebook, Google) function
[Rails] Implementation of like function
Memorandum [Rails] User authentication Devise
[Rails] Implementation of multi-layer category function using ancestry "Editing form"
[Rails] Implementation of multi-layer category function using ancestry "Creation form"
[Rails] Implementation of tagging function using intermediate table (without Gem)
[Rails] Implementation of user logic deletion
[Rails] Implementation of CSV import function
[Rails] Asynchronous implementation of like function
[Rails] Implementation of image preview function
Implement user management functionality using Devise
[Rails] About implementation of like function
[Rails] Implementation of CSV export function
Implementation of validation using regular expressions
Implementation of like function in Java
[Rails 6] Implementation of new registration function by SNS authentication (Facebook, Google)
[Rails] Implementation of coupon function (with automatic deletion function using batch processing)
[Rails] Implementation of tag function using acts-as-taggable-on and tag input completion function using tag-it
[Android] Implementation of side-scrolling ListView using RecyclerView
Rails [For beginners] Implementation of comment function
[Rails 6] Implementation of SNS (Twitter) sharing function
Implementation of tabs using TabLayout and ViewPager
[Vue.js] Implementation of menu function Implementation version rails6
[Ruby on rails] Implementation of like function
[Vue.js] Implementation of menu function Vue.js introduction rails6
[Rails] I will explain the implementation procedure of the follow function using form_with.
How to implement the email authentication function at the time of user registration
Implementation of Ruby on Rails login function (Session)
Use [Rails] devise Guest user function (for portfolio)
DM function implementation
[FCM] Implementation of message transmission using FCM + Spring boot
Today's learning summary: With user management function implementation
Story of implementing login function using gem sorcery
Tag function using acts-as-taggable-on on Devise My memo
devise user registration
[Rails] Implementation of retweet function in SNS application