• CONTACT

TheTechnologist.TV

  • the column

Loading...
Loading...
Home › Blogs › Wolfram Arnold's blog

Nested Attributes and how much fun it is to give a talk with a live demo

Wolfram Arnold — Wed, 07/22/2009 - 07:29

Tonight, I presented at the East Bay Ruby Meetup on invitation of Jon Seidel, the host, a talk about a very cool new feature in Rails 2.3.

This feature is about allowing you to create complex forms that involve the creation, updating, and deletion of data from multiple nested models. By nested models, we mean models that have some sort of has_one/has_many - belongs_to relationship with each other. The new Rails feature is a model directive named "accepts nested attributes_for" that lets you send the nested hash from a form post to the parent model and all child associations will be updated.

If the preceding paragraph sounds cryptic and abstract to you, I apologize, but the point of this blog post is not the repeat the presentation. Take a look at the slides on Slideshare and at the demo project on github. The video filmed thankfully by Paul Lundahl will be forthcoming shortly. So you're covered on content.

2009 07 21: Nested Attributes

View more presentations from Wolfram Arnold.

What I wanted to share is how engaging and fun it was to do a full-on live demo. I started with a bit of theory and description of the problem and then we worked through building a full application (full thanks for rspec scaffold) with the key bits illustrated succinctly and I believe understandably.

The audience was great and engaged. They were with me with every typo, every little success and every little speedbump. What I thought had been a Rails bug turned out not to be thanks to the watchful eyes and ideas of a participant.

The big lesson for me tonight was that the sandwiching of Abstract—Example—Abstract rocks.

(Thanks to Josh Susser for his comments at the end of my talk last week at the SF Ruby Meetup with Sarah Allen.)

The first abstract piece introduces the problem, but if it stays there, it just remains academic and we're tempted to ask "so what?" The example brings it into our reality, we see the problem as it would show up in a real life scenario. If things stay there, it'll be nifty but the larger scope isn't revealed. The final piece of the abstract ties things together in a broader context.

My broader context was why Web API's shouldn't be chatty, why there should be few well defined entry points, why exposing the backend data schema to REST controllers is a bad idea, why keeping the skinny controller—fat model paradigm helps with testing and maintainability, why working in Rails is fun and cool.

No fewer than three people found themselves inspired to contribute their book tips, which is awesome. I had heard of some of them but had not read any of them but now I sure will take a closer look:

 

 

  • Entertainment
  • Jon Seidel
  • Josh Susser
  • Paul Lundahl
  • Ruby Meetup
  • Wolfram Arnold's blog

AUDIT THE FED

Latest

Generative Art From The Math of The Rodin Vortex, The Fibonacci Spiral, and The Gielis Superformula
2 days 14 hours ago
An Historic Press Release
2 weeks 4 days ago
Tahrir Tilt Shift
2 weeks 5 days ago

Below The Fold

On "The Ascent of Money", A BBC Series on The History of Finance
6 weeks 4 days ago
The History of All Earth Ever, as A Drop of Water on The Sun (abstract)
6 weeks 4 days ago
FTC Deals FaceBook The Largest "Hump On The Wrist" In Silicon Valley History
8 weeks 2 days ago
In The 6 Months Since I Closed The Lab, 11|3L3V3N Happened
10 weeks 4 days ago
When Did I Become Dr Who?
39 weeks 1 day ago
more

Active Topics

  • Technology
  • Google
  • Android
  • iPhone
  • Entertainment

AUDIT THE FED

  • the column