validates_attachment_size :image, :less_than => 5.megabytes
gives an error message of
Image file size must be less than 5242880 Bytes
This isn't very user friendly.. Is there a way to make the message to be
Image file size must be less than 5 MB
? without setting a custom message on my own
Nope. You need to set a custom message to get that format. You can see from the paperclip source that they convert the size to an integer number of bytes in human_size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With