Join The East Bay Ruby Meetup Group

You'll get invited to our Meetups as soon as they're scheduled!

New in Rails 2.3: Associated models accepts_nested_attributes_for

Jul 2009 21
Tue 6:30 PM
Location
Wozniak Lounge

Soda Hall, UC Berkeley
Corner of Hearst & LeRoy
Berkeley, CA 94701

This is a private home or office

Estimated attendance
 31  people attended.
5.00 5.0010

Who organized?
Jon Seidel

6:30 - 7:00 - Open Mike

7:00 - 8:15 - Featured presentation

8:15 - 8:30 - Jobs Offered/Desired

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 www.divinecaroline.com at Pivotal Labs and RGM. Recent consulting engagements have included www.edufire.com, www.fansnap.com, www.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.

Photos of this Meetup

No photos yet.

Talk about this Meetup

Who attended?