[Ruby on Rails] Error that Couldn't find User with ... after logging out

environment

macOS 10.15.4 Ruby 2.5 Rails 5.2

error contents

スクリーンショット 2020-05-24 14.04.16.png After logging out, I implemented a process to move to the top page in the logged out state, and when I tried to log out, I got an error like the picture ...

There is no mistake in the code description There is no defect in the javascript description of the head ... If so, what is the cause of the error ...

I found an article that ** cannot be done with GET if the Http method of sign_out is DELETE.

Change Http method from DELETE to GET

Go to config / initializers / devise.rb. Then edit the value of config.sign_out_via from DELETE to GET.

config.sign_out_via = :get

When I ran it again after this edit, the error was fixed brilliantly ^ _ ^

Recommended Posts

[Ruby on Rails] Error that Couldn't find User with ... after logging out
Rails6 Couldn't find User with'id' = sign_out and cannot log out
[Ruby on Rails] View test with RSpec
Notes on using FCM with Ruby on Rails
[Ruby on Rails] Controller test with RSpec
Introducing Rspec with Ruby on Rails x Docker
Publish the app made with ruby on rails
[Rails] Procedure for linking databases with Ruby On Rails
Determine the current page with Ruby on Rails
[Ruby on Rails] Individual display of error messages
I made a portfolio with Ruby On Rails
[Ruby on Rails Tutorial] Error in the test in Chapter 3
[Ruby on Rails] Delete s3 images with Active Strage
Run Ruby on Rails RSpec tests with GitHub Actions
Error encountered with notes when deploying docker on rails
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
[Ruby on Rails] Only the user who posted can edit
I tried installing Ruby on Rails related plugin with vim-plug
[Ruby on Rails] undefined method ʻid'for nil: NilClass error resolution method
[Ruby on Rails] Add a column with a foreign key constraint
(Ruby on Rails6) Display of the database that got the id of the database
From Ruby on Rails error message display to Japanese localization
[Ruby on Rails] Implement login function by add_token_to_users with API
[Apple login] Sign in with Apple implementation procedure (Ruby on Rails)
How to make an application with ruby on rails (assuming that the environment has been built)
List of copy and paste collections that are useful when creating apps with Ruby on Rails
Portfolio creation Ruby on Rails
Ruby on rails learning record -2020.10.04
[Ruby on Rails] Debug (binding.pry)
Ruby on rails learning record -2020.10.05
Ruby on Rails basic learning ①
[Ruby on Rails] about has_secure_password
Ruby on rails learning record-2020.10.07 ②
Commentary on partial! --Ruby on Rails
Ruby on rails learning record-2020.10.07 ①
Cancel Ruby on Rails migration
Ruby on rails learning record -2020.10.06
Ruby on Rails Basic Memorandum
[Rails] [ActiveStorage] Find out if a particular user has an avatar
I want to add a browsing function with ruby on rails
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
Understand code coverage with Rspec, the Ruby on Rails test framework
[Ruby on Rails] Posting function that only logged-in users can post
Steps to build a Ruby on Rails development environment with Vagrant