title: Uploading multiple images
body: <p>I have problem with uploading multiple images using dropzone.js </p>
  
  <p><strong>I'm getting this error:</strong></p>
  
  <pre><code>Paperclip::AdapterRegistry::NoHandlerError (No handler found for "0"):
  </code></pre>
  
  <p><strong>This is how look parameters when I'm submitting form with dropzone</strong></p>
  
  <pre><code>Processing by CarsController#create as JSON
  Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"ND6DrphXI6sYZ+IGZd8HllyGR/74PbmBsyRCHqsRZO2BpgVNLCqJpkokW57pQ5lVaPm9AVzredrHNg9Lc8y1eQ==", "car"=&gt;{„brand”=&gt;"Audi ", "model"=&gt;"A6"}, "null"=&gt;"", "commit"=&gt;"Create Car", "images"=&gt;{"0"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007fc42bcc4308 @tempfile=#&lt;Tempfile:/var/folders/f5/x2w5mbln30q9q70f1mqxy3hc0000gn/T/RackMultipart20170926-645-1hajljx.png&gt;, @original_filename=„car.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"images[0]\"; filename=\”car.png\"\r\nContent-Type: image/png\r\n"&gt;}}
  </code></pre>
  
  <p><strong>And without dropzone</strong></p>
  
  <pre><code>Processing by CarsController#create as HTML
  Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"Pwp4IlmBXuaKN8GZ5TGckKpxRlpteKtsGqgVPE/rK3yKkv7B7fz063h0eAFprQJTmxe8pcm+azduullplzbz7A==", "car"=&gt;{„brand”=&gt;"Audi ", "model"=&gt;"A6"}, "images"=&gt;[#&lt;ActionDispatch::Http::UploadedFile:0x007fc428b41b50 @tempfile=#&lt;Tempfile:/var/folders/f5/x2w5mbln30q9q70f1mqxy3hc0000gn/T/RackMultipart20170925-645-sxrzzm.png&gt;, @original_filename=„car.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"images[]\"; filename=\”car.png\"\r\nContent-Type: image/png\r\n"&gt;], "commit"=&gt;"Create Car"}
  </code></pre>
  
  <p>Without dropzone everything works fine. </p>
  
  <p><strong>This is my form</strong></p>
  
  <pre><code>&lt;%= form_with(model: car, local: true, :html =&gt; {:multipart =&gt; true, :class =&gt; "dropzone", :id =&gt; 'myAwesomeDropzone'}) do |form| %&gt;
  
  
  &lt;%= file_field_tag "images[]", multiple: true %&gt;
  
  &lt;%= form.submit :id =&gt; „submit” %&gt;
  
  
  &lt;% end %&gt;
  </code></pre>
  
  <p><strong>Dropzone settings</strong>   </p>
  
  <pre><code> Dropzone.options.myAwesomeDropzone = { 
        autoProcessQueue: false,
        uploadMultiple: true,
        parallelUploads: 100,
        paramName: "images",
        maxFiles: 100,
  
        init: function() {
          var myDropzone = this;
  
          this.element.querySelector(„#submit”).addEventListener("click", function(e) {
            e.preventDefault();
            e.stopPropagation();
            myDropzone.processQueue();
          });
  
        }
  
      }
  </code></pre>
  
  <p><strong>Car Controller</strong></p>
  
  <pre><code>  def create
       @car = Car.new(car_params)
        respond_to do |format|
        if @car.save
           if params[:images]
            params[:images].each { |image|
              @car.pictures.create(image: image)
            }
          end
  
          format.html { redirect_to @car, notice: 'Car was successfully created.' }
          format.json { render :show, status: :created, location: @car }
        else
          format.html { render :new }
          format.json { render json: @car.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>
  
  <p><strong>Picture model</strong></p>
  
  <pre><code>class Picture &lt; ApplicationRecord
  
  belongs_to :car
    has_attached_file :image, :processors =&gt; [:watermark],
                      :styles =&gt; { 
                                   :thumb =&gt; '150x150&gt;', 
                                   :original =&gt; { :geometry =&gt; '1920x1080#', :watermark_path =&gt; "#{Rails.root}/public/images/logo.png" } 
                                 },
                      :url    =&gt; '/assets/attachment/:id/:style/:basename.:extension',
                      :path   =&gt; ':rails_root/public/assets/attachment/:id/:style/:basename.:extension',
                      :default_url =&gt; "/images/:style/mising.png"
  validates_attachment :image,
    content_type: { content_type: ["image/jpeg", "image/gif", "image/png"] }
  end
  </code></pre>
  
  <p>I haven't any idea how to solve this problem, I'm counting on yours help</p>