
Rails 2.3: Associated models accepts_nested_attributes_for
2 years ago
This is the video of a presentation by Wolfram Arnold at the East Bay Ruby Meetup, July 21, 2009.
Presentation Abstract:
One of my first surprises when I discovered Rails in 2006 was that there was no built-in way to update or create models with child associations in one go. Either the controller code got messy, or the forms got split across multiple screens or the database schema got mangled to conform to a better user experience. There was no graceful stock solution. Until Rails 2.3.
The new "accepts_nested_attributes_for" feature is a powerful answer to this problem. It lets you assign attributes to an entire hierarchy of model associations through a single line of code in the controller.
We'll introduce the feature, examples, common use cases and some gotchas to watch out for. And we'll briefly talk about object identity and the hot-off-the press addition of the :inverse_of association parameter, in the 2.3.4 release, and it how it can help with presence validations when using nested attribute updates.
Bio:
Wolfram Arnold, Ph.D. is co-founder of RubyFocus, a Ruby-on-Rails consulting and recruiting firm and has been working on consumer web applications in Ruby-on-Rails since 2006. He learned the ropes while working on divinecaroline.com at Pivotal Labs and RGM. Recent consulting engagements have included edufire.com, fansnap.com, mightyverse.com. He specializes in Rails scalability, best practices, user tracking, and using the latest industry, open-source and 3rd party tools. Wolfram is based in San Francisco.
Presentation Abstract:
One of my first surprises when I discovered Rails in 2006 was that there was no built-in way to update or create models with child associations in one go. Either the controller code got messy, or the forms got split across multiple screens or the database schema got mangled to conform to a better user experience. There was no graceful stock solution. Until Rails 2.3.
The new "accepts_nested_attributes_for" feature is a powerful answer to this problem. It lets you assign attributes to an entire hierarchy of model associations through a single line of code in the controller.
We'll introduce the feature, examples, common use cases and some gotchas to watch out for. And we'll briefly talk about object identity and the hot-off-the press addition of the :inverse_of association parameter, in the 2.3.4 release, and it how it can help with presence validations when using nested attribute updates.
Bio:
Wolfram Arnold, Ph.D. is co-founder of RubyFocus, a Ruby-on-Rails consulting and recruiting firm and has been working on consumer web applications in Ruby-on-Rails since 2006. He learned the ropes while working on divinecaroline.com at Pivotal Labs and RGM. Recent consulting engagements have included edufire.com, fansnap.com, mightyverse.com. He specializes in Rails scalability, best practices, user tracking, and using the latest industry, open-source and 3rd party tools. Wolfram is based in San Francisco.
-
Vimeo: About / Blog / Developers / Jobs /
Community Guidelines /
Help Center / Video School / Music Store / Site Map
/ Vimeo
or
-
Legal: TM + ©2012 Vimeo, LLC. All rights reserved. / Terms of Service / Privacy Statement / Copyright

Prev week