Sha256: 8876eafa998b94dc9a2ab0b4107c59f1546804f27c1a8a34bc34f36e27c147c6
Contents?: true
Size: 1.15 KB
Versions: 18
Compression:
Stored size: 1.15 KB
Contents
class Picture < Document has_attached_file :file, :url => '/:class/:id.:extension', :path => ':rails_root/documents/:class/:id_partition/:style', :styles => {:thumb48sq => ["48x48"], :thumbwall => ["130x97#"], # midwall preserves A4 proportion: 210x297 :midwall => ["80x113#"], :preview => ["500>"] } define_index do activity_object_index indexes file_file_name, :as => :file_name end # Thumbnail file def thumb(size, helper) case size when 16 "#{ size.to_s }/photo.png" when 48 helper.picture_path self, :format => format, :style => 'thumb48sq' when 80 helper.picture_path self, :format => format, :style => 'midwall' when 130 helper.picture_path self, :format => format, :style => 'thumbwall' when 500 helper.picture_path self, :format => format, :style => 'preview' end end end
Version data entries
18 entries across 18 versions & 2 rubygems