UPDATE: It's official, Rails 2.3 supports nested models in the view. This should provide the capability to create complex forms, so forget about all this plugin crap.
Ah! Do not reinvent the wheel!
James Golick has created a plugin based on Ryan Bate's complex forms railscast called attribute_fu. How nice! Looks like I'll scrap AssociationFu and use his attribute_fu plugin. Woo hoo! Nice to have a plugin that already has support and a community following. Also, attribute_fu seems to be compatible with unobtrusive Javascript.
It looks to be simpler and better thought out in terms of its hooks into the model class. I suspect it does not have the features that association_fu has but hopefully it is extensible, should those features be necessary -- like child validation and error reporting. Also, I'll be very interested in seeing if it will work with check box fields.
James also posted about presenters, which looks like a good solution to the complex contracts form. There is also a chapter on presenters in the Advanced Rails Recipes book.
UPDATE: James says that future versions of Rails will incorporate a similar capability, so attribute_fu may have a limited lifespan. But so far, his plugin kicks proverbial arse and I've been really enjoying how quickly and easily I can create forms that updates attributes in a model's association. Woo hoo!
Friday, August 1, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment