title: Rails 4 | Unpermitted parameter: images when using Paperclip to upload multiple images using Paperclip form
body: <p>Struggling with strong parameters when using simple-form to upload multiple images from paperclip in my form. I'm constantly getting an error popping up on the server</p>
  
  <p>"Unpermitted parameters: images"</p>
  
  <p>When the form tries to upload into the Database. Ok so here's what I've got so far. </p>
  
  <p>Form code: </p>
  
  <pre><code>&lt;%= f.input :images, as: :file, input_html: { multiple: true } %&gt;
  </code></pre>
  
  <p>Desks Controller:</p>
  
  <pre><code>def new
      @desk = current_user.desks.build
  
      @desk.office_type_id = params[:office_type_id]
      @desk.desk_type_id = params[:desk_type_id]
  
      @amenities = Amenity.all
      @desk.amenity_ids = params[:amenities]
  
  end
  
  def create
      @desk = current_user.desks.build(desk_params)
  
  
      if @desk.save
  
          if params[:images]
              params[:images].each do |image|
                  @desk.photos.create(image: image)
              end
          end
  
          @photos = @desk.photos
          redirect_to edit_desk_path(@desk), notice: "Saved..."
      else
          render "new"
      end
  end
  
  
  private
      def set_desk
          @desk = Desk.find(params[:id])
      end
  
  def desk_params
      params.require(:desk).permit(:office_type_id, :desk_type_id, 
          :office_type, :desk_type, :listing_name, :min_days, :max_days, 
          :accommodate, :daily_rate, :location, :description, :amenities, 
          amenity_ids: [], 
          :photos_attributes =&gt; [ :images ])
  end
  </code></pre>
  
  <p>I have a photos model: </p>
  
  <pre><code>class Photo &lt; ActiveRecord::Base
      belongs_to :desk
  
      has_attached_file :image, styles: { medium: "300x300&gt;", thumb: "100x100&gt;" }
      validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
  end
  </code></pre>
  
  <p>Desk Model: </p>
  
  <pre><code>    has_many :photos
  </code></pre>
  
  <p>I have tried whitelisting just  .., :images , and .., :images => [] ,</p>
  
  <p>Neither successful. I'm sure I've tried other combinations that will allow an array into the mix. </p>
  
  <p>One point worth noting is the server code example of multiple images upload is showing an array being pulled into the parameters. Example: </p>
  
  <pre><code>Processing by DesksController#update as HTML
  
  
   Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"hgEIE6yirx7ixY8Xs0mUxA+6G3wmy/D4wKSLKrF+clTfzvpunFG11PmEfI2l3bPV0IlCywdmvajshMph7c5V+A==", "desk"=&gt;{"office_type_id"=&gt;"1", "desk_type_id"=&gt;"1", "accommodate"=&gt;"1", "min_days"=&gt;"1", "max_days"=&gt;"2", "listing_name"=&gt;"1111", "description"=&gt;"111", "location"=&gt;"111", "daily_rate"=&gt;"100", "amenity_ids"=&gt;["2", "3", ""], "images"=&gt;[#&lt;ActionDispatch::Http::UploadedFile:0x007fba71ce2880 @tempfile=#&lt;Tempfile:/var/folders/gx/86yj74bx3md88cfn2fwc975h0000gn/T/RackMultipart20170713-20588-1bin85a.JPG&gt;, @original_filename="IMG_1420.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"desk[images][]\"; filename=\"IMG_1420.JPG\"\r\nContent-Type: image/jpeg\r\n"&gt;, #&lt;ActionDispatch::Http::UploadedFile:0x007fba71ce2268 @tempfile=#&lt;Tempfile:/var/folders/gx/86yj74bx3md88cfn2fwc975h0000gn/T/RackMultipart20170713-20588-1ac6bwu.JPG&gt;, @original_filename="IMG_1421.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"desk[images][]\"; filename=\"IMG_1421.JPG\"\r\nContent-Type: image/jpeg\r\n"&gt;]}, "commit"=&gt;"Update Desk", "id"=&gt;"37"}
  </code></pre>
  
  <p>This has been very frustrating. Would appreciate any help or guidance to what is going on here. I was sure it may be a nesting issue but still cant get it to work with the current code. Thanks a mil.</p>