title: Carrierwave Multiple File Upload + No implicit conversion of nil into String
body: <p>Trying to get Carrierwave multiple file uploads working.  I'm following the documentation on the homepage.  When I try to upload a file or multiple, I get an <code>no implicit conversion of nil to string</code></p>
  
  <p>That error is coming from this method in the Carrierwave gem found in <code>uploaders/cache.rb</code></p>
  
  <pre><code>def workfile_path(for_file=original_filename)
      File.join(CarrierWave.tmp_path, @cache_id, version_name.to_s, for_file)
   end
  </code></pre>
  
  <p>The issue is that the original_file is nil.  I've tried to trace the issue but can't find where the issue is really beginning.  One thing that is odd is that I am following some source code from this repo </p>
  
  <p><code>https://github.com/bobintornado/sample-gallery-app-with-carrierwave</code></p>
  
  <p>The sample app is working and you can do multiple uploads.  The difference though is that when <code>cache!</code> method is called the <code>new_file</code> is an <code>Array</code> where in sample app that's working it's <code>Http::UploadedFile</code></p>
  
  <p>Here's the cache method</p>
  
  <pre><code>  def cache!(new_file = sanitized_file)
      new_file = CarrierWave::SanitizedFile.new(new_file)
      return if new_file.empty?
  
      raise CarrierWave::FormNotMultipart if new_file.is_path? &amp;&amp; ensure_multipart_form
  
      self.cache_id = CarrierWave.generate_cache_id unless cache_id
  
      @filename = new_file.filename
      self.original_filename = new_file.filename
  
      begin
        # first, create a workfile on which we perform processings
        if move_to_cache
          @file = new_file.move_to(File.expand_path(workfile_path, root), permissions, directory_permissions)
        else
          @file = new_file.copy_to(File.expand_path(workfile_path, root), permissions, directory_permissions)
        end
  
        with_callbacks(:cache, @file) do
          @file = cache_storage.cache!(@file)
        end
      ensure
        FileUtils.rm_rf(workfile_path(''))
      end
    end
  </code></pre>
  
  <p>Here are my initial params</p>
  
  <pre><code>"coach"=&gt;{"name"=&gt;"ben", "title"=&gt;"ceo", "description"=&gt;"head dude",
  "photos"=&gt;[
      #&lt;ActionDispatch::Http::UploadedFile:0x007fc9a5235c78 @tempfile=#&lt;Tempfile:/var/folders/sb/t6rry5j928l3sy96nkhy9f840000gn/T/RackMultipart20160113-67635-avg8ef.jpg&gt;, @original_filename="benn-1.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"coach[photos][]\"; filename=\"benn-1.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;,
      #&lt;ActionDispatch::Http::UploadedFile:0x007fc9a5235c50 @tempfile=#&lt;Tempfile:/var/folders/sb/t6rry5j928l3sy96nkhy9f840000gn/T/RackMultipart20160113-67635-r8bdxp.jpg&gt;, @original_filename="benn-2.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"coach[photos][]\"; filename=\"benn-2.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;
  ]}
  </code></pre>