Skip to content

Instantly share code, notes, and snippets.

@tibra
Created February 2, 2011 10:08
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 tibra/807493 to your computer and use it in GitHub Desktop.
Save tibra/807493 to your computer and use it in GitHub Desktop.
Should set default_options for paperclip for better DRY.
module Paperclip
class Attachment
def self.default_options
@default_options ||= {
:url => ":attachment/:id/:style.:extension",
:path => ":rails_root/public:url",
:s3_credentials => "#{Rails.root}/config/s3.yml",
:storage => :s3,
:styles => {},
:processors => [:thumbnail],
:convert_options => {},
:default_url => "/:attachment/:style/missing.png",
:default_style => :original,
:whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails]
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment