title: accepts_nested_attributes_for not saving paperclip image
body: <p>I am trying to save images through nested model</p>
  
  <p>**model:</p>
  
  <pre><code>Listing 
      has_many:photos
      accepts_nested_attributes_for :photos, :allow_destroy =&gt; true
  
  Photo 
      belongs_to:listing
     has_attached_file :data, :styles=&gt;{:featured =&gt; "88x63#", :search_result =&gt; "122x91#"}
  </code></pre>
  
  <p>listings controller:</p>
  
  <pre><code>def new
      @listing = Listing.new
      @listing.photos.build
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml =&gt; @listing }
      end
    end
  
   def create
      @listing = Listing.new(params[:listing])
      if @listing.save
        redirect_to(:action=&gt;'index')
      else
        render :action =&gt; "new"
      end
  end
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>  &lt;%= form_for [@listing] do |f| %&gt;
     &lt;%= f.fields_for :photos do |ph| %&gt;
        &lt;%= ph.file_field :data %&gt;
     &lt;% end%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <hr>
  
  <p>Here I mentioned only one field in the view, but I used lot of fields and all are saved in the database except the data (image) field.</p>
  
  <p>If I validate the presence of data in the Photo model I got "photo should not be empty" message though I uploaded a image.</p>