Can I use a PUT method in an HTML form to send data from the form to a server?
_method hidden field workaround
The following simple technique is used by a few web frameworks:
add a hidden _method parameter to any form that is not GET or POST:
This can be done automatically in frameworks through the HTML creation helper method.
fix the actual form method to POST (
processes _method on the server and do exactly as if that method had been sent instead of the actual POST
You can achieve this in:
form_tag@method("PATCH")Rationale / history of why it is not possible in pure HTML: https://softwareengineering.stackexchange.com/questions/114156/why-there-are-no-put-and-delete-methods-in-html-forms