rails devise, no route matches logout

旧巷老猫 提交于 2019-11-30 12:09:59
vich

I had a nearly identical problem and thanks to SO fixed it quite easily (link to my question). First, make sure you have <%= javascript_include_tag :defaults %> in your layout file "application.html.erb."

Then, in your config -> initializers -> "devise.rb" file make sure it says:

config.sign_out_via = :delete

and your "sign_out" code destroy_user_session_path, :method => :delete should work.

jahrichie

A little late to this party, but here's some help from another answer

Specify your method:

<%= link_to "sign out", destroy_user_session_path, method: :delete %>
ashish gupta

Set config.sign_out_via = :get in config/initializers/devise.rb to use the following code for your sign out link.

<%= link_to "Sign Out", destroy_user_session_path %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!