title: Unpermitted parameters in Carrierwave file upload
body: <p>I have Rails 4 + CarrierWave + Nested form for <code>Ad</code> model which as many <code>Image</code> (mount <code>PictureUploader</code> as <code>picture</code>)</p>
  
  <p>When I try to add or edit <code>Ad</code>, I have unpermitted parameters <code>picture</code></p>
  
  <pre><code>Parameters: {"utf8"=&gt;"✓", 
  "ad"=&gt;{
     "title"=&gt;"plot", 
     "images_attributes"=&gt;
        { "0" =&gt; 
           { 
              "picture"=&gt;[#&lt;ActionDispatch::Http::UploadedFile:0x007fbea1ddedb8 @tempfile=#&lt;Tempfile:/var/folders/t8/fm77jh7j6232v5km2llkgq1r0000gn/T/RackMultipart20140921-33609-54hs6k&gt;, @original_filename="New-york-rental-apartment-1-.gif", @content_type="image/gif", @headers="Content-Disposition: form-data; name=\"ad[images_attributes][0][picture][]\"; filename=\"New-york-rental-apartment-1-.gif\"\r\nContent-Type: image/gif\r\n"&gt;],
              "_destroy"=&gt;"false"
           }
        }
     }
  }
  
  Unpermitted parameters: parent_id
  Unpermitted parameters: parent_id
  Unpermitted parameters: picture
  </code></pre>
  
  <p>I permitted the param with following. (according to <a href="http://guides.rubyonrails.org/action_controller_overview.html#more-examples" rel="nofollow">this Rails Guide</a>, my code should be working)</p>
  
  <pre><code>params.require(:ad).permit(:picture, :title, :images_attributes =&gt; [:picture, :id, :_destroy])
  </code></pre>
  
  <p>I only get fallback picture from carrierwave and now I'm clueless.</p>
  
  <p>EDIT 1:</p>
  
  <p>Found <a href="https://github.com/carrierwaveuploader/carrierwave/issues/786" rel="nofollow">this issue</a> on github discussing about Carrierwave not working with nested forms.</p>
  
  <p>Also found <a href="https://gist.github.com/978371" rel="nofollow">A complete sample of how to perform nested polymorphic uploads in rails using carrierwave</a>. It is in Rails 3 and I haven't tested it yet. </p>