I was working with Devise in Rails and while setting up the sign_out function I run into errors. I noticed than, it happened because pages which have sign_out link skipped layouts so Javascript was inactive. By enabling javascript with:`
<%= javascript_include_tag :defaults %>
everything just worked fine.
Why does it work like that?
links are (normally) always get requests. In order for a link to send a non-get request you need some javascript that modifies the behaviour of the link.
In addition browsers typically only support GET/POST requests so rails fakes up the other methods (DELETE, PUT,…) by adding a _method field to the post.