Lighthouse has a new layout.
Prefer the old one? Return to the old layout,
and switch back any time from the link at the top of each page.
This project is archived and is in readonly mode.
form_for targeting wrong url
#3823
I SOLVED THIS PROBLEM WITH :URL =>
RESOURCE_PATH(@RESOURCE), BUT I DON'T KNOW HOW TO CLOSE THE TICKET.
PLEASE CLOSE THIS, IF YOU COME ACROSS
IT.
Wondering if anyone can help, or is having the same problem. I
have a form_for helper nested inside an index view, because index
viewers need to be able to update a parameter without going to a
separate page (like the edit route). But this form is sending a put
request to the non-specific route (/resources) instead of the
specific route indicated in the generated html (/resources/:id).
Put requests should be directed to the specific route to call the
update action, so I'm getting an error and the database does not
update.
(controller is default scaffolded version)
(index.html.erb)
<td><% form_for :resource do |f|%>
<%= f.text_field :parameter %>
<%= f.submit 'Update' %>
<% end %></td>