Skip to content

Instantly share code, notes, and snippets.

@adriand
Created August 20, 2010 17:20
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 adriand/540757 to your computer and use it in GitHub Desktop.
Save adriand/540757 to your computer and use it in GitHub Desktop.
module Paperclip
# The Attachment class manages the files for a given attachment. It saves
# when the model saves, deletes when the model is destroyed, and processes
# the file upon assignment.
class Attachment
def self.default_options
@default_options ||= {
:url => "/system/:class/:attachment/:id/:style/:basename.:extension",
:path => ":rails_root/public/system/:class/:attachment/:id/:style/:basename.:extension",
:styles => {},
:default_url => "",
:default_style => :original,
:validations => {},
:storage => :filesystem, # if you wish to use S3 everywhere, change this to :storage => :s3
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml"
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment