Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to PATCH or DELETE from a form without javascript

I am writing a simple crud app on Phoenix. How does one submit PATCH and DELETE requests from a form without using javascript?

like image 997
greggreg Avatar asked Jan 27 '15 05:01

greggreg


1 Answers

Ah I figured it out, same as rails:

<form method="POST">
  <input name="_method" type="hidden" value="patch" />
...

Handled in Plug.MethodOverride: https://github.com/elixir-lang/plug/blob/master/lib/plug/method_override.ex

like image 75
greggreg Avatar answered Feb 28 '23 19:02

greggreg