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.

Was it helpful?

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top