From 258e89b76e0ffd1a7e4e9728267587e820833a6b Mon Sep 17 00:00:00 2001 From: John Harris, Jr Date: Tue, 22 Sep 2009 04:29:59 -0700 Subject: [PATCH] Edited lines from the example section to match what worked properly when I tested creating new objects with *_attributes in the hash. Basically, it should be *.create(:model_name) rather than *.create('model_name'). --- .../lib/active_record/nested_attributes.rb | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 3c81408..2e3d59d 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -53,7 +53,7 @@ module ActiveRecord # It also allows you to update the avatar through the member: # # params = { :member' => { :avatar_attributes => { :id => '2', :icon => 'sad' } } } - # member.update_attributes params['member'] + # member.update_attributes params[:member] # member.avatar.icon # => 'sad' # # By default you will only be able to set and update attributes on the @@ -100,7 +100,7 @@ module ActiveRecord # ] # }} # - # member = Member.create(params['member']) + # member = Member.create(params[:member]) # member.posts.length # => 2 # member.posts.first.title # => 'Kari, the awesome Ruby documentation browser!' # member.posts.second.title # => 'The egalitarian assumption of the modern citizen' @@ -122,7 +122,7 @@ module ActiveRecord # ] # }} # - # member = Member.create(params['member']) + # member = Member.create(params[:member]) # member.posts.length # => 2 # member.posts.first.title # => 'Kari, the awesome Ruby documentation browser!' # member.posts.second.title # => 'The egalitarian assumption of the modern citizen' -- 1.6.2.2