Hey, this turned out alright! http://github.com/cainlevy/complex-form-examples/tree/cainlevy
Some notes on my implementation: * I made a point to show that everything works without JavaScript. But it would be easy to sprinkle some JS in to hide the template row and clone it for "add another" functionality. The hardest part would be generating a unique id and inserting it into the field names, but that seems doable. * Improved form helpers could clean this up a lot. I assume that's doable in a different iteration. * I decided to recast the "delete" checkbox as a "keep" checkbox. That's not necessary though. What's necessary is that the template row will by default be deleted on submit, unless the user indicates otherwise. I just like the semantics of checking a box to *keep* the record instead of to delete the record. As for the gist, my paradigm parameters appear to be different from #4 in that they use a suffixed hash key (:tasks_params instead of :tasks), and they indicate deletion via a :_delete key instead of missing rows. I like the :_delete key much better for supporting non- JS agents. -Lance On Dec 12, 4:58 pm, Ryan Bates <[email protected]> wrote: > Hi Lance, > > It's great to see more attention brought to this subject. I would love > to work on this more but at the moment I do not have the time. It > would be nice if something like this could get in core for Rails 2.3. > > On Dec 12, 2:58 pm, cainlevy <[email protected]> wrote: > > > Ryan, I don't believe this is onhttp://gist.github.com/10793. > > The gist isn't intended to address singular associations or deletions. > Without that your approach looks similar to #4. Are there other > significant differences? > > Also, have you tried implementing a multi-model form with this plugin? > You can fork my complex-form-examples project on GitHub and create > your own branch for this. > > http://github.com/ryanb/complex-form-examples/tree/master > > Thanks for your work on this, > > Ryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
