Skip to content

Instantly share code, notes, and snippets.

@nevernormal1
Created April 23, 2010 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevernormal1/377185 to your computer and use it in GitHub Desktop.
Save nevernormal1/377185 to your computer and use it in GitHub Desktop.
class << self
def image_styles
ActiveSupport::OrderedHash.new.tap do |styles|
styles[:original] = {:processors => [:slice]}
styles[:preview] = {:geometry => "100x100", :processors => [:thumbnail]}
end
end
end
has_attached_file :image,
:styles => self.image_styles,
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => ":attachment/:id/:style/:basename.:extension"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment