I am using the devise gem to make authentication work in my app.
Here’s the code I have for signing out:
<%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
I have tried this as well:
<%= link_to "Sign out", destroy_user_session_path%>
Both of which when I click on sign out I get :
No route matches [GET] "/users/destroy"
However when I run rake routes, you can see it (just not GET):
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
How to fix this?
Could this help you in the right direction?
https://github.com/plataformatec/devise/issues/1195