Created
February 2, 2010 00:50
-
-
Save stve/292236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAPERCLIP_CONFIG = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AMAZON_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/amazon_s3.yml")[RAILS_ENV] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAPERCLIP_CONFIG = { | |
:path => ":class/:attachment/:id/:style/:basename.:extension", | |
:storage => :s3, | |
:s3_credentials => AMAZON_CONFIG, | |
:s3_permissions => 'public-read', | |
:bucket => AMAZON_CONFIG['bucket'], | |
:s3_host_alias => AMAZON_CONFIG['bucket'], | |
:url => ":s3_alias_url" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
has_attached_file :avatar, { | |
:url => "/system/users/:attachment/:id/:style/:basename.:extension", | |
:path => ":rails_root/public/system/users/:attachment/:id/:style/:basename.:extension", | |
:styles => { :thumb => ['48x48#', :png], :large => ['125x125#', :png] }, | |
:default_url => "/images/avatars/user/default_:style.jpg" | |
}.merge(PAPERCLIP_CONFIG) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment