destroy_user_session_path is triggering GET instead of DELETE in Rails

后端 未结 3 1265
梦谈多话
梦谈多话 2021-01-23 15:55

I have the following code in my view:

  • <%= link_to \'Sign out\', destroy_user_session_path, method: :delete %>
  • Which

    3条回答
    •  灰色年华
      2021-01-23 16:51

      Do you have

      //= require jquery 
      //= require jquery_ujs
      

      in your application.js file?

      An alternative monkey patch would be to modify the devise.rb and change the signout method to get like so

      config/initializers/devise.rb

      config.sign_out_via = :get
      

      This post may shed some light: Rails 3.2 with Devise: logout link stopped working

    提交回复
    热议问题