I am seeing some strange behavior on Rails 6.0.2.2
My haml code is like this, but I also get this result using Erb syntax.
// skins/_list.haml
Edit
= skin.name
for
= skin.account.company_name
= form_with model: skin, url: edit_dashboard_skin_path(skin) do |f|
= render partial: "form", locals: {skin: skin, f: f}
Notice that the partial is rendered within the form, thus you would expect
<form action="/dashboard/skins/2/edit" accept-charset="UTF-8" data-remote="true" method="post">
<input type="hidden" name="_method" value="patch">
<input type="hidden" name="authenticity_token" value="67DBVfnagSrI+DZMxfv/calLBjWq8EV2YFqMDI8oJN/ltqp1jLh3Oa64gZBRhmY25nQUsZEuFK8P/UgCLII8AA==">
/* other form fields here */
</form>
However, Rails seems to be rendering ALL of the form content—including the hidden fields and any arbitrary text I stick inside of the form_with do block, as siblings of the form, not children of the form .
PLEASE SEE SO POST FOR FOLLOW-UP HERE: