[RUBY] Login function

    1. Install Gem and restart the server Add the following code to the Gemfile The place to add is gem'devise' on the last line of Gemfile Then bundle install in the terminal Let's restart the local server rails s
  1. Let's create a devise configuration file using commands To use devise, create a configuration file using devise-specific commands in addition to installing Gem.

Rails g devise: install in terminal

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

    1. Let's create a Users model using commands When using devise, create a new User model for creating an account. Create a User model with devise's model creation command instead of the usual model creation method

Rails g devise user in the terminal

app/models/user.rb  db/migrate/20XXXXXXXXXXXX_devise_create_users.rb  test/fixtures/users.yml test / models / user_test.rb is created devise_for: users is automatically added to routes.rb

Execute the migration file created by the rails g devise user command earlier Rails db: migrate in terminal This will create the users table The routing has changed, so restart the server  rails s

Recommended Posts

Login function
Addition of guest login function
Login function with Spring Security
Implement simple login function in Rails
JavaScript function
SpringMVC-Interceptor function
[Rails] Function restrictions in devise (login / logout)
Rails Addition of easy and easy login function
Make a login function with Rails anyway
Login function implementation by Spring Security (securityConfig)
Create a login function using Swift's Optional
Validation settings for Ruby on Rails login function
Implementation of Ruby on Rails login function (Session)
Basic Web application creation Servlet / JSP (login function)
Password change function
Pagination function (kaminari)
DM function implementation
Image preview function
[Swift] How to implement the LINE login function
[Rails 6] Ranking function
Image posting function
Try to implement login function with Spring Boot
[Rails] Category function
Rails follow function
[Note] Summary of rails login function using devise ①
Implemented comment function
[Rails] Notification function
Ruby on Rails <2021> Implementation of simple login function (form_with)
Implementation of Ruby on Rails login function (devise edition)
Java / Twitter clone / task management system (2) Add login function
Rails tutorial (6th edition) Background operation of login function
Create a login authentication screen using the session function