Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leklund/paperclip_multiple_s3_accounts
Paperclip extension to allow for multiple Amazon S3 accounts
https://github.com/leklund/paperclip_multiple_s3_accounts
Last synced: 11 days ago
JSON representation
Paperclip extension to allow for multiple Amazon S3 accounts
- Host: GitHub
- URL: https://github.com/leklund/paperclip_multiple_s3_accounts
- Owner: leklund
- License: mit
- Created: 2011-02-03T15:07:36.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-02-03T15:08:17.000Z (almost 14 years ago)
- Last Synced: 2024-10-25T13:00:50.425Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 84 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
Paperclip-multiple-s3-accounts
==============================PaperclipMultipleS3Accounts extends Paperclip (https://github.com/thoughtbot/paperclip). It adds functionality to pass the s3_credentials for has_attached_file as a Proc. This allows the use of for multiple S3 accounts per object in a single application.
Example
=======In your model:
class User < ActiveRecord::Base
belongs_to :s3bucket
has_attached_file :photo,
:storage => :s3,
:s3_permissions => "public-read",
:path => "/:attachment/:id/:basename.:extension",
:s3_credentials => (lambda do |attachment|
h = {
'bucket' => attachment.instance.s3bucket.name,
'access_key_id' => attachment.instance.s3bucket.access_key_id,
'secret_access_key' => attachment.instance.s3bucket.secret_access_key
}
end)Copyright (c) 2011 Lukas Eklund, released under the MIT license