In application development, when I implemented the user management function using devise before creating the top page, I noticed the devise redirect specification that seemed to be known but not known, so I will keep it as a record.
Before creating the top page, I implemented the new registration function with devise and checked the operation in the local environment (localhost: 3000), and after the new registration, I redirected to the familiar top page of Rails.
After processing the new registration function (controller: devise/registration # create), you will be redirected to the root path (root_path).
If you haven't set the root path (root_path) in route.rb
, you'll see the Rails familiar top page.
After processing the logout function (controller: devise/sessions # destroy), you will be redirected to the login screen (controller: devise/sessions # new).
When I noticed the above-mentioned new registration → redirect to the root path and wondered "Where will I be redirected after logging out?", I found that it was redirected to the login screen.