I'm trying to use Paperclip to fill in "image" field at ActiveAdmin Post edit page. Rails 4.0.0, Paperclip 4.2.0. In Post model i've added following code:
has_attached_file :image
validates_attachment :image, content_type: { content_type: [ "image/jpg", "image/jpeg", "image/png" ] }
After submitting form i have following error:
Paperclip::Error in Admin::PostsController#update
Post model missing required attr_accessor for 'image_file_name'
Looks like I've forgotten to do something. What've i missed to do at this step? Ok, I've manually added
attr_accessor :image_file_name
After submitting i get another error
NoMethodError in Admin::PostsController#update
undefined method `image_content_type' for #Post:0x007fb148266e10
I don't know what to do with this one.
attr_accessor :imagein your model? - Ashley