<% = link_to'logout','logout_path, method:: delete%>
Click the link
No route matches [GET]'/ login'
is displayed.
↓
The request has been sent by Get instead of Delete.
↓
If you check the HTML, you can see the description of data-method =" delete "
in the corresponding a tag.
None of the following has changed
--Load jquery_ujs
with app/javascripts/packs/application.js
--Modify the js file reading part in the head
--Add gemjquery-rails
After changing link_to
to button_to
, method:: delete
now works.
But I still want to use link_to
.
$ yarn remove @fullhuman/postcss-purgecss
After deleting the npm library called postcss-purgecss
, which I introduced but eventually stopped using, method:: delete
came to work.
Recommended Posts