title: Ruby On rails accepts_nested_attributes_for simple question
body: <p>Below is a simplified view of my two models User and Patient.</p>
  
  <p>A User has_one Patient and a Patient belongs_to a user.</p>
  
  <p>What I am trying to do in the rails console is:</p>
  
  <pre><code>p = Patient.new(:user_id =&gt; 2, :user_attributes =&gt; [{:username =&gt; 'patient'},{:password =&gt; 'password'}])
  </code></pre>
  
  <p>I get the error:
  NoMethodError: undefined method `with_indifferent_access' for [{:username=>"patient"}, {:password=>"password"}]:Array</p>
  
  <p><strong>What am I doing wrong?</strong></p>
  
  <p><strong>Below are the two models:</strong></p>
  
  <pre><code># == Schema Information
  #
  # Table name: users
  #
  #  id                 :integer         not null, primary key
  #  username           :string(255)
  #  encrypted_password :string(255)
  #  salt               :string(255)
  #  active             :boolean
  #  disabled           :boolean
  #  last_login         :time
  #  first_name         :string(255)
  #  last_name          :string(255)
  #  address1           :string(255)
  #  address2           :string(255)
  #  city               :string(255)
  #  state              :string(255)
  #  postcode           :string(255)
  #  phone              :string(255)
  #  cell               :string(255)
  #  email              :string(255)
  #  created_at         :datetime
  #  updated_at         :datetime
  #
  class User &lt; ActiveRecord::Base
    has_one :patient
  
    attr_accessible :username, :password, :active, :disabled, :first_name, :last_name, 
    :address1, :address2, :city, :state, :postcode, :phone, :cell, :email
    attr_accessor :password
  
  end
  
  # == Schema Information
  #
  # Table name: patients
  #
  #  id         :integer         not null, primary key
  #  user_id    :integer
  #  created_at :datetime
  #  updated_at :datetime
  #
  
  class Patient &lt; ActiveRecord::Base
    belongs_to :user
    accepts_nested_attributes_for :user
    attr_accessible :user_id, :user_attributes
  end
  </code></pre>