How to submit a form to custom url with a different HTTP method?
-
12-11-2019 - |
Question
I'm using simple_form gem to build my forms, and I'd like to submit a form to "/messages/delete_all" with the DELETE method. How can I do that with simple_form?
Here is what I have so far:
=simple_form_for :messages, :url=>{:action=>"delete_all"} do |f|
=f.button :submit, "Delete"
This doesn't seem to work, though. It submits to "/messages/delete_all" with POST.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow