Nested forms support? #1411
Unanswered
usern3
asked this question in
Feature requests & Ideas
Replies: 1 comment 1 reply
-
Yeah, we have a plan to support this. It's just lower on the list of TODOs because it's a less common practice. Especially with more people going the SPA route, and forms being written on the javascript side. I thought we had an open issue already. I'm pretty sure I've even written an example of what the interface would look like 🤔 but I can't seem to find it now. But yes, this is definitely something we want to support 👍 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was recently working on something where nested forms would have saved a ton of time and code. I'm wondering if there's any plans to implement this in the future? Right now, the only way I've found to achieve something similar is by creating attributes in the save operation and then define methods to save those attributes to another models save op. This can get very messy with the nil checks.
Then there's the problem of populating the other models fields when editing. To populate them you need methods that query the other model and provide the default value to the atrribute. This introduces a problem when creating, since those values may not yet exist. So a separate operation would be necessary for creating an updating. You can see how this gets a bit messy.
If you arent familiar with nested forms, here's a little example of them in Rails: https://levelup.gitconnected.com/the-many-things-about-nested-form-in-ruby-on-rails-15f32ed66446
Beta Was this translation helpful? Give feedback.
All reactions