Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Photo < ActiveRecord::Base
- has_attachment :content_type => :image,
- :storage => :file_system,
- :resize_to => '800x600>',
- :thumbnails => { :thumb => '80x80>', :main => '375x375>'},
- :processor => :rmagick
- validates_as_attachment
- def resize_image(img, size)
- self.temp_path = write_to_temp_file(img.to_blob {self.quality = 30})
- end
- end
Add Comment
Please, Sign In to add comment