Nested forms support
zamith opened this issue · 4 comments
zamith commented
Does formulaic support nested forms? Is it going to?
Thanks
calebhearth commented
Yes, but it's harder.
fill_form(:main_object, main_object_attributes)
fill_form(:nested_object, nested_object_attributes)
That should work because it uses the first argument only to find translations. It won't work when you have nested has_many relationships except with a within('#selector')
block for each form / formset id. It's not pretty, and not an ideal use case.
If you can come up with a nicer way of doing this, I'm open to suggestions, but I'm skeptical that there are good solutions that remain backward compatible and not confusing.
zamith commented
Yup. That works. Thanks.
calebhearth commented
Sweet. Since you just got this working, do you want to add an example to the README of doing that?
zamith commented
Sure. I'll do that.