I get an error message from some validation code that I have in my model. My system uses paperclip to attach many files to a help article, and I know that I have paperclip installed because I can download files just without checking them.
Here is my model:
class HelpAttachment < ActiveRecord::Base
belongs_to :help
has_attached_file :attachment,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
validates_attachment :attachment, :content_type => [ 'image/png', 'image/jpg', 'image/gif', "application/pdf",
'video/mpeg', 'video/quicktime', 'video/x-ms-asf', 'video/x-msvideo',
'video/x-flv' ]
end
And this is the error message that I get when I try to send a new attachment:
NoMethodError in HelpsController
undefined method `validates_attachment' for #<Class:0x00000005581498>
If I delete the validates_attachment line, everything will work, just checking the file will not.
I have a gem 'paperclip' in my gemfile and I am starting in development mode.
Any ideas?
Noz source
share