destroy_user_session_path is triggering GET instead of DELETE in Rails

后端 未结 3 1241
梦谈多话
梦谈多话 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:48

      link_to fails back to a get if Javascript is not enabled. Looks like either your browser has Javascript disabled or more likely there is a Javascript error on the page. If there is an uncaught Javascript error on your page all other Javascript will fail to run after the error occurs.

    提交回复
    热议问题