Okay, so i've got paperclip working, and I'm trying to use the built in validator to make sure that the file uploaded
- Is an image
- Is not too big
So I have this in the model, per the documentation:
validates_attachment :avatar,
:content_type => { :content_type => /image/ },
:size => { :in => 0..2.megabytes }
However the error it shows in the view is this mess:
I'd like it to be something a bit simpler, like "Avatar must be an image less than 2 megabytes"
However, I can't see where to do this, as passing :message => 'something'
throws an error Unknown validator: 'MessageValidator'
How do I go about cleaning this up?
Note that the happy path of uploading a small image works just fine.
Some further testing shows that uploading an image that's too big (like a desktop background) or something that's not a .rb file fails more gracefully, but doesn't display any error message at all. Still not quite what I want.