Closed jberry closed 4 years ago
Tracked it down with other google searches that lead to other Cocoon errors;
End answer: specify
form_name: 'form'
in the link_to_add;
Hopefully my including "form_with" in the issue name will help lead others here as well :)
Broke:
<%= link_to_add_association 'add option', form, :job_step_options, partial: 'job_step_options/job_step_option_fields' %>
Working with additional form_name field:
<%= link_to_add_association 'add option', form, :job_step_options, partial: 'job_step_options/job_step_option_fields', form_name: 'form' %>
I am attempting to implement cocoon inside of a form_with form, and running into:
My form definition starts with:
<%= form_with(model: job_definition_step, local: true) do |form| %>
And I am attempting to setup the link_to as such:
<%= link_to_add_association 'add option', form, :job_step_options, partial:'job_step_options/job_step_option_fields' %>
And my partial is very basic right now (which appears to be where the error is thrown, line 3 in this file which is calling form.label):
In my debug console poking at the form variable:
This is running with cocoon 1.2.14, ontop ruby 2.5.3 and rails 6.0.2.1.
I'm not sure what all to attach for additional data, but glad to provide whatever is necessary/dumps of variables/etc as requested.