Created
September 5, 2009 21:52
-
-
Save baldwindavid/181527 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # this allows you to use a CNAME for multiple environments | |
| # Paperclip only supports multiple access, secret access and bucket | |
| # in your model... | |
| has_attached_file :attachment, | |
| :path => ":class/:id/:style_:basename.:extension", | |
| :storage => :s3, | |
| :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", | |
| :s3_host_alias => YAML.load_file("#{RAILS_ROOT}/config/s3.yml")[RAILS_ENV]["s3_host_alias"], | |
| :url => ":s3_alias_url" | |
| # in config/s3.yml | |
| development: | |
| bucket: development_assets.my_company_domain.com | |
| access_key_id: XXXXXXXXXXXXX | |
| secret_access_key: XXXXXXXXXXXXXXXXX | |
| s3_host_alias: development_assets.my_company_domain.com | |
| test: | |
| bucket: test_assets.my_company_domain.com | |
| access_key_id: XXXXXXXXXXXXX | |
| secret_access_key: XXXXXXXXXXXXXXXXX | |
| s3_host_alias: test_assets.my_company_domain.com | |
| production: | |
| bucket: assets.client_domain.com | |
| access_key_id: XXXXXXXXXXXXX | |
| secret_access_key: XXXXXXXXXXXXXXXXX | |
| s3_host_alias: assets.client_domain.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment