Yes, but update_attributes will look for a child_hash_name= method in
your model. It''ll pass in the child hash. Check out the "complex
forms" railscasts--that goes over everything you need.
-----Original Message-----
From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of
Bob Cober
Sent: Tuesday, June 10, 2008 8:06 AM
To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [Rails] ActiveRecord update_attributes with nested hash
Can the parameter hash passed to update_attributes include nested hashes
for child models related through has_many?
For example, if A has many B, can the parameter hash passed to A
include a nested hash for B?
It seems the hash can include attributes for A e.g. one level deep.
Thanks for any advice....
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---