title: Problem with file uploads in a nested form using Rails3 with Mongoid and Carrierwave
body: <p>Im having a problem transferring an SQLlite Rails 3 app over to a Mongoid Rails 3 app.  In the SQLlite version, I am easily able to include an image upload form (using Paperclip) from one model ('image') within a nested form from another model ('product').  Here's my 'new' product form:</p>
  
  <pre><code>  &lt;%= form_for @product, :html =&gt; {:multipart =&gt; true} do |f| %&gt;
       &lt;% f.fields_for :images do |image_form| %&gt;
         &lt;%= f.label :productphoto %&gt;
         &lt;%= f.file_field :productphoto %&gt;&lt;br /&gt;
      &lt;% end %&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>And here's the 'show' view:</p>
  
  <pre><code>    &lt;% @product.images.each do |image| %&gt;
        &lt;%= image_tag image.productphoto.url(:gallerythumb) %&gt;&lt;br /&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>When I try to use the same product views in my Mongoid Rails 3 app (using Carrierwave), I get the following error:</p>
  
  <pre><code>    TypeError in Stores#show: 
      can't convert nil into String
      &lt;%= image_tag product.image.url(:gallerythumb) %&gt;
  </code></pre>
  
  <p>Im pretty sure my models in the Mongoid version are correct because if I add a string (like 'name') to my 'image' model and nest that in the 'Product' form, it works.  Also, Im able to upload an image into a non-nested model form.</p>
  
  <p>Any help would be greatly appreciated! </p>