Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix nested attributes examples again.

Those hashes don't have indifferent access.
  • Loading branch information...
commit 329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc 1 parent 10f3cf0
@oggy oggy authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/nested_attributes.rb
View
6 activerecord/lib/active_record/nested_attributes.rb
@@ -46,14 +46,14 @@ module NestedAttributes #:nodoc:
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.