From 5f5acf9b6d04ebd5b6fcf4e707c4357d636faa5a Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 13 Feb 2015 14:48:55 +0800 Subject: [PATCH] change show method image thumb size --- app/controllers/galleries_controller.rb | 2 +- app/uploaders/gallery_uploader.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 1840757..62dbf5d 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -24,7 +24,7 @@ class GalleriesController < ApplicationController { "image-description" => a.description, "link_to_show" => "/" + I18n.locale.to_s + params[:url] + "/-" + a.id.to_s + "?method=theater", - "thumb-src" => a.file.thumb.url + "thumb-src" => a.file.thumb_fixed_width.url } end { diff --git a/app/uploaders/gallery_uploader.rb b/app/uploaders/gallery_uploader.rb index a87ac5f..150677b 100644 --- a/app/uploaders/gallery_uploader.rb +++ b/app/uploaders/gallery_uploader.rb @@ -53,6 +53,10 @@ class GalleryUploader < CarrierWave::Uploader::Base process :resize_to_fill => [200, 200] end + version :thumb_fixed_width do + process :resize_to_limit => [200, 0] + end + version :theater do process :resize_to_limit => [1920, 1080] end