[Ruby] Adding multiple new related ActiveRecord objects

James Moore banshee at banshee.com
Thu Nov 16 15:29:42 PST 2006


I'm feeling some fuzziness around the concept of what's really dependant on
what. 

Can the children exist outside of the parent?  The mental model seems to be
"here's the definition of a company and some info about a contact; if the
company's already there, use the existing record.  Now add this contact to
the company."  

> > But if I follow the 
> > scaffolding pattern (new vs. create) for making a new Company, I 
> > won't yet have a @company.id to supply for my new Contacts when I 
> > try AJAXically to add them.

Try restating the problem without worrying about ajax.  Ajax is fluff, not
meat; if you've got an interaction between how you think about your data and
ajax, something has gone horribly wrong.

 - James Moore



More information about the Ruby mailing list