Created by: gracewashere
Closes #192 (closed)
Feature:
When I create or edit a model that has_many nested models, I want to view and edit the attributes of the nested models so I can set up all the relationships with a single form.
Implementation:
Introduce a new field type, NestedHasMany
.
I considered building the feature into the existing HasMany
field,
but this would get in the way of HasMany
relationships
that aren't directly nested, such as in many-to-many relationships.
The NestedHasMany
field builds off of the Cocoon gem.
It renders fields from the nested model,
based on the fields defined in the nested model's dashboard class.
Cocoon provides helpers and javascript to easily add and remove nested form fields from the page.
Preview
Next Steps
-
Needs some design love -
Needs tests -
It would be great to have people test this on their own apps and report bugs before we merge