title: "Association type mismatch "? In paperclip
body: <p>I am using paperclip to upload user avatar.Evrery thing work well but when i hit the save button i got the error :</p>
  
  <pre><code>    ActiveRecord::AssociationTypeMismatch in UsersController#update
  
      Usernote(#79841148) expected, got Array(#25890648)
  
      Request
  
  Parameters:
  
  {"authenticity_token"=&gt;"bLhGiceEIEohpuuclDpbmpzJR7SFb4HEY4+Qy9ER20E=",
   "_method"=&gt;"put",
   "utf8"=&gt;"✓",
   "id"=&gt;"2",
   "user"=&gt;{"user_information"=&gt;{"passport_number"=&gt;"",
   "passport_expiry_date"=&gt;"",
   "gender"=&gt;"Male",
   "birth_date"=&gt;"",
   "marriage_date"=&gt;"",
   "present_address"=&gt;"",
   "blood_group"=&gt;"",
   "emergency_contact"=&gt;"",
   "marital_status"=&gt;"Married"},
   "usernotes"=&gt;{"notes"=&gt;"Hi this is First note from Ritz"},
   "designation_id"=&gt;"2",
   "username"=&gt;"ritz",
   "reporting_to_id"=&gt;"",
   "avatar"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x9514578 @headers="Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"child ravi.jpg\"\r\nContent-Type: image/jpeg\r\n",
   @content_type="image/jpeg",
   @original_filename="child ravi.jpg",
   @tempfile=#&lt;File:C:/Users/user/AppData/Local/Temp/RackMultipart20111207-2300-3nkxr9-0&gt;&gt;,
   "last_name"=&gt;"roshan",
   "user_salary_detail"=&gt;{"work_phone"=&gt;"",
   "EPS_account_number"=&gt;"",
   "work_type"=&gt;"Permanent",
   "date_of_joining"=&gt;"",
   "work_location"=&gt;"",
   "branch"=&gt;"",
   "PF_account_number"=&gt;"",
   "bank_name"=&gt;"",
   "PAN"=&gt;"",
   "status"=&gt;"Active",
   "bank_account_number"=&gt;""},
   "password"=&gt;"[FILTERED]",
   "department_id"=&gt;"1",
   "first_name"=&gt;"hritwik",
   "email"=&gt;"rvdthakur@yahoo.com"}}
  </code></pre>
  
  <p>Here is My Model:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
     has_attached_file :avatar,
                      :styles =&gt; {
                        :thumb =&gt; "75x75#",
                        :small =&gt; "100x100#",
                        :medium =&gt; "150x150&gt;"
                      },
                      :default =&gt; :thumb,
                      :url =&gt; "/users/user_avatar/:attachment/:id/:style/:basename.:extension",  
                      :path =&gt; ":profitnext/public/images/users/user_avatar/:attachment/:id/:style/:basename.:extension"  
  
  # avatar validations
    validates_attachment_size :avatar, :less_than =&gt; 5.megabytes
    validates_attachment_content_type :avatar, :content_type =&gt; ['image/jpeg', 'image/png'] 
  end
  </code></pre>
  
  <p>and My View:</p>
  
  <pre><code>&lt;%= image_tag @user.avatar.url %&gt;
                &lt;%= image_tag @user.avatar.url(:thumb) %&gt;
  </code></pre>
  
  <p>I got that error after hitting save button.I am struggling with this a lot.Thanks in advance.</p>