Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yesod PUT and DELETE using hidden _method parameter

Is there an easy way to have yesod read a POST request as a PUT or DELETE when it has a special parameter: _method=DELETE? And render forms with it?

like image 434
user316146 Avatar asked Jun 09 '26 17:06

user316146


1 Answers

Yesod uses the methodOverride middleware by default which allows this. When I use this approach, I just put it into the action attribute of the form, e.g.:

<form method=post action=@{SomeRouteR}?_method=DELETE>
like image 105
Michael Snoyman Avatar answered Jun 12 '26 11:06

Michael Snoyman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!