title: Rails + Paperclip: Nested attributes file_field form helper not working?
body: <p>I have a form:</p>
  
  <pre><code>    &lt;%= form_for [:admin, @category], :html =&gt; { :multipart =&gt; true } do |f| %&gt;
  
      &lt;%= f.collection_select(:parent_id, Category.all, :id, :title, include_blank: true) %&gt;&lt;br /&gt;
  
      &lt;%= f.label :title %&gt;&lt;br /&gt;
      &lt;%= f.text_field :title %&gt;&lt;br /&gt;
  
      &lt;%= f.label :description %&gt;&lt;br /&gt;
      &lt;%= f.text_area :description %&gt;&lt;br /&gt;
  
  
  
      &lt;%= fields_for :category_image do |category_image_fields| %&gt;
          &lt;%= category_image_fields.file_field :attachment %&gt;&lt;br /&gt;
      &lt;% end %&gt;
  
      &lt;%= f.submit %&gt;
  
  
      &lt;% end %&gt;
  </code></pre>
  
  <p>but when I freeze it and try it out using the better_errors gem it doesn't seem to work:</p>
  
  <pre><code>    &gt;&gt; params
      =&gt; {"utf8"=&gt;"✓", "authenticity_token"=&gt;"JWT+P6OQHKQC+sx5ytNoyAaGEKwCHb15Mb0H7FSJlTM=", "category"=&gt;{"parent_id"=&gt;"3", "title"=&gt;"ffff", "description"=&gt;"ffff"}, "category_image"=&gt;{"attachment"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007fdd375e9590 @original_filename="bacon.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"category_image[attachment]\"; filename=\"bacon.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#&lt;File:/var/folders/nw/zzv_cpt94_18vhvmcwk26gh80000gr/T/RackMultipart20131017-37289-1k42gos&gt;&gt;}, "commit"=&gt;"Create Category", "action"=&gt;"create", "controller"=&gt;"admin/categories"}
      &gt;&gt; c=Category.new(params[:category])
      =&gt; #&lt;Category id: nil, title: "ffff", description: "ffff", parent_id: 3, created_at: nil, updated_at: nil&gt;
      &gt;&gt; c.category_image
      =&gt; nil
  </code></pre>
  
  <p>This is my model that uses paperclip that stands for the image:</p>
  
  <pre><code>class CategoryImage &lt; Asset #&lt;-- trying to reuse it for other models too
    belongs_to :category
  end
  
  
  
  class Asset &lt; ActiveRecord::Base
    has_attached_file :attachment
    validates_attachment_presence :attachment
    validates_attachment_content_type :attachment,
                                      :message =&gt; "Please upload correct format",
                                      :content_type =&gt; %w( image/jpeg image/png image/pjpeg image/x-png image/gif)
  
    has_attached_file :attachment, :styles =&gt; { :small =&gt; '100' }
  
    attr_accessible :attachment
  end
  </code></pre>
  
  <p>and this is my Category model that should <code>has_one</code> image:</p>
  
  <pre><code>class Category &lt; ActiveRecord::Base
    attr_accessible :title, :description, :category_image, :parent_id
  
    has_many :subcategories, class_name: 'Category', foreign_key: 'parent_id', dependent: :destroy
    belongs_to :parent_category, class_name: 'Category', foreign_key: 'parent_id'
  
    has_many :books
    has_one :category_image
    accepts_nested_attributes_for :category_image
  
    validates_presence_of :title, :description
  end
  </code></pre>