From 0e51685dcf6eb1e5ae9c124c87e52a3b0e9eeb3d Mon Sep 17 00:00:00 2001 From: yafeilee Date: Mon, 26 May 2014 20:31:41 +0800 Subject: [PATCH] add photo size adjust --- app/uploaders/photo_uploader.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/uploaders/photo_uploader.rb b/app/uploaders/photo_uploader.rb index 3286872..4a336fb 100644 --- a/app/uploaders/photo_uploader.rb +++ b/app/uploaders/photo_uploader.rb @@ -9,7 +9,15 @@ class PhotoUploader < CarrierWave::Uploader::Base "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end - process :resize_to_limit => [680,nil] + process :resize_to_limit => [1200,nil] + + version :medium do + process :resize_to_limit => [640,nil] + end + + version :small do + process :resize_to_limit => [400,nil] + end def extension_white_list %w(jpg jpeg gif png)