Config rails devise to use GET for sign_out

Views: 6816 | Add Comments

If you get rails route error like this:

No route matches [GET] "/sign_out"

That’s because Devise uses HTTP DELETE to logout the session, but you will never be able to do this by clicking a link in a web page.

Then, just config your config/initializers/devise.rb to use

# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :get

Restart rails server.

Posted by ideawu at 2014-05-03 16:15:28

Leave a Comment