Domanda

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.

È stato utile?

Soluzione

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top