More detailed error message
This commit is contained in:
parent
2878dbfad6
commit
40cd474ee3
1 changed files with 2 additions and 2 deletions
|
|
@ -16,8 +16,8 @@ class ImageUploader < Shrine
|
||||||
Attacher.validate do
|
Attacher.validate do
|
||||||
validate_size 0..MAX_SIZE
|
validate_size 0..MAX_SIZE
|
||||||
|
|
||||||
if validate_mime_type ALLOWED_TYPES
|
if validate_mime_type ALLOWED_TYPES, message: "must be a valid JPEG or PNG file"
|
||||||
validate_max_dimensions MAX_DIMENSIONS
|
validate_max_dimensions MAX_DIMENSIONS, message: "must be not larger than 2000x2000 pixels"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue