title: Saving array of nested attributes with accepts_nested_attributes_for
body: <p>Project and tasks have a one-to-many relationship, and project <code>accepts_nested_attributes_for :tasks</code>.</p>
  
  <p>In the form, my task objects look like:</p>
  
  <pre><code>project[tasks][2][assigned_time]
  project[tasks][2][due_time]
  </code></pre>
  
  <p>When the form is submitted I get a hash like:</p>
  
  <blockquote>
    <p>Parameters: {"utf8"=>"✓", "authenticity_token"=>"...=",
    "project"=>{"id"=>"1", "tasks"=>{"1"=>{"assigned_time"=>"09:00",
    "due_time"=>"17:00"}, "2"=>{"assigned_time"=>"09:00",
    "due_time"=>"17:00"}}</p>
  </blockquote>
  
  <p>Then I expect them to be saved by just saving the project object:</p>
  
  <pre><code>project = Project.find(params[:id])
  
  respond_to do |format|
    if project.update_attributes(params[:tasks])
  </code></pre>
  
  <p>But I get:</p>
  
  <blockquote>
    <p>WARNING: Can't mass-assign protected attributes: id   SQL (0.3ms)
    ROLLBACK Completed in 169ms</p>
    
    <p>ActiveRecord::AssociationTypeMismatch (Task(#2188181260) expected, got
    Array(#2151973780)):</p>
  </blockquote>
  
  <p>Any ideas how to fix this?</p>