I added the method: patch
to the form_with
helper (like it said to in this SO post)
<%= form_with(model: [:admin, contest], method: :patch) do |form| %>
...
and the <input type="hidden" name="_method" value="patch">
shows up (like it's supposed to) but then when I click "Submit", the request is still a POST request and I get the error
No route matches [POST] "/admin/contests/7"
I had the same issue, and resolved it by changing it to:
Update: You're right, "patch" and :patch do the same. I also added the url from my routes file:
I think I need some more info. What does your controller look like? What model is it? Have you tried specifying the model and the url in form_with?