title: TypeError (can't convert Symbol into Integer) when using jQuery fileupload plugin
body: <p>I am using jQuery fileupload plugin to upload multiple pictures. Inspect the data sent to the server, it was:</p>
  
  <pre><code>Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"pE6KRzQv05wwcutCRN0UlZ3Cy39cNAtEYCMbkoVtwBQ=", "poll"=&gt;{"title"=&gt;"fjijgg", "category"=&gt;"1", "items_attributes"=&gt;{"brand"=&gt;"item 3", "photo"=&gt;[#&lt;ActionDispatch::Http::UploadedFile:0x007fe609c377a0 @original_filename="Photo Nov 20, 1 19 44 AM.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"poll[items_attributes[photo]][]\"; filename=\"Photo Nov 20, 1 19 44 AM.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#&lt;File:/var/folders/3s/xggrbr6119v_mtcqn9r0b6tr0000gn/T/RackMultipart20121120-1465-d21tys&gt;&gt;]}}}
  </code></pre>
  
  <p>The poll and item models set up as:</p>
  
  <pre><code>class Item &lt; ActiveRecord::Base
    attr_accessible :photo, :photo_url, :poll_id, :brand, :number_of_votes,:description, :is_deleted
    has_attached_file :photo,
                      :styles =&gt; { :thumbnail =&gt; "100x100#",
                                     :small =&gt; "150x150&gt;",
                                     :medium =&gt; "250x250&gt;",
                                     :large =&gt; "400x400&gt;" },
                      :storage =&gt; :s3,
                      :s3_credentials =&gt; S3_CREDENTIALS,
                      :url=&gt;"/item_:id/created_at_:created_at/:style.jpg"
    belongs_to :poll
  end
  
  class Poll &lt; ActiveRecord::Base
      attr_accessible :title, :user_id, :category, :items_attributes
      belongs_to :user
      has_many :items, :dependent =&gt; :destroy
      accepts_nested_attributes_for :items
      default_scope :order =&gt; 'polls.created_at DESC'
  end
  </code></pre>
  
  <p>And the poll controller:</p>
  
  <pre><code>class PollsController &lt; ApplicationController
    def create
      @poll=Poll.create(params[:poll])
      redirect_to @poll
    end
  end
  </code></pre>
  
  <p>I got the error:</p>
  
  <pre><code>TypeError (can't convert Symbol into Integer):
  </code></pre>
  
  <p>I thought it was caused by "items_attributes" => {...}.Any suggestions about how to fix it?</p>
  
  <p>Thanks</p>