문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top