Dragonfly: How to set max image size?
-
25-05-2021 - |
Question
How to set max image size and weight/height using Dragonfly? Max size will be different for different models, so i would like to set it in model lvl.
La solution
According to this post, http://blog.new-bamboo.co.uk/2010/1/13/dragonfly, you can do it with the following, where 400 is the max
class Album
validates_property :width, :of => :cover_image, :in => (0..400)
end
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow