I would like to create a form which works in the connection table between a "M:N" relation. So the user is able to add multiple rows of a parent model in one form.
Can some help me to bring this working? What should be the associations? My problem is the same like here.
Thank you very much for your help!
Looks like you are trying to do some nesting have you tried these tuts from railscasts
http://railscasts.com/episodes/196-nested-model-form-part-1
http://railscasts.com/episodes/197-nested-model-form-part-2
Also checkout this for some guidance on the types of relations you want
http://railscasts.com/episodes/47-two-many-to-many
You could always do that manually inside the controller without rails' form_for helper.
Thats actually what the second part of the answer to the question you linked to suggests.
Just like the answer mentions, giving <input> fields names ending with [] (e.g. <input type="text" name="field[]">) results in that field being an array in the params hash inside the controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With