I am trying to use Desive authentication.
Everything went smoothly until this point (sign up and sign in).
But I cannot make the sign out link work. I checked the destination link with rake routes
; destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
.
But when I put <%= link_to "sign out", destroy_user_session_path %>
on the home page and clicked on the link, I received this error; No route matches [GET] "/users/sign_out"
.
As an aside, I'm currently running Ruby-2.0.0-p195, and Rails 3.2.13
Use method DELETE
<%= link_to "sign out", destroy_user_session_path, method: :delete %>
You need to pass "method: delete" to send as DELETE request. If you dont set "method: delete", then it will be sent as GET request.
<%= link_to "Sign Out" ,destroy_user_session_path, method: :delete %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With