diff options
author | George Ogata <george.ogata@gmail.com> | 2009-09-29 11:37:29 -0400 |
---|---|---|
committer | George Ogata <george.ogata@gmail.com> | 2009-09-29 11:37:29 -0400 |
commit | 329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc (patch) | |
tree | 3204ef6e804210a0138d73ad4ac6d3f19719fa90 | |
parent | 10f3cf00b8cca86a088fc98fa46fdff0b027a495 (diff) | |
download | rails-329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc.tar.gz rails-329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc.tar.bz2 rails-329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc.zip |
Fix nested attributes examples again.
Those hashes don't have indifferent access.
-rw-r--r-- | activerecord/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 c808c5191e..9c29f32639 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -46,14 +46,14 @@ module ActiveRecord # create the member and avatar in one go: # # params = { :member => { :name => 'Jack', :avatar_attributes => { :icon => 'smiling' } } } - # member = Member.create(params['member']) + # member = Member.create(params[:member]) # member.avatar.id # => 2 # member.avatar.icon # => 'smiling' # # It also allows you to update the avatar through the member: # - # params = { :member' => { :avatar_attributes => { :id => '2', :icon => 'sad' } } } - # member.update_attributes params['member'] + # params = { :member => { :avatar_attributes => { :id => '2', :icon => 'sad' } } } + # member.update_attributes params[:member] # member.avatar.icon # => 'sad' # # By default you will only be able to set and update attributes on the |