New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No route matches [GET] "/users/sign_out" #4486
Comments
Let me add something weird which I am seeing through Console:
What it sounds weird to me is that it first triggers the DELETE to the correct "place", then a GET to "/" and, finally, the GET to "users/signo_out" which generates the error. |
Guys, |
In my case the problem occurred because I'm not using jquery on the project |
Still facing the same problem (and I am not even using js) |
hey, @kinsbrunner , did you manage to solve this problem? I have the same issue and I'm can't figure out what's the problem |
I solved this issue using jquery-ujs.
|
Is there any way to get this working without having to use jQuery? |
By default the sign out route uses the DELETE HTTP method. You can either make an ajax yourself - without the help of jQuery - or change the Devise configuration to accept sign out as a GET request. Devise.setup do |config|
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :get
end |
You can use the button_to helper and style the button if you need.
|
hi Jorge, it's worked |
Having the same problem here. My app is not using any JS and @kinsbrunner shouldn't this issue be reopened? |
Can you reopen this issue? |
Can you provide a sample application that reproduces the issue? If we can confirm it's reproducible in a sample app, we can reopen and investigate further. Thanks. |
I found that issue. In rails 6, I had include jquery and popper.js
This fixed the problem. |
Tegon;s solution worked for me Devise.setup do |config| The default HTTP method used to sign out a resource. Default is :delete.config.sign_out_via = :get |
I fixed this by installing the gem "rails-ujs" and going into app/assets/javascripts/application.js and adding this code: Hope this helps anyone dealing with this error |
Dont know if someone still has this issue but i did a combination of 2 solutions: i changed HTTP default :delete to :get (by @tegon ) Devise.setup do |config|
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :get
end and |
Thank you so much, you saved my day ... |
Hi guys,
I have been struggling for hours with this error which happens when having a link_to for destroying the session. For some reason, a GET is being sent instead of a DELETE action which makes this error happen.
Some points to highlight:
<%= link_to 'Exit', destroy_user_session_path, method: :delete %>
)Not sure whether this could be related to the version of a gem (already played using previous versions of jQuery, Devise, etc)
Kindly let me know your ideas.
Thanks and regards.
Alejandro.
The text was updated successfully, but these errors were encountered: