This repository has been archived by the owner on Jun 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
h2. Works only for Rails 3 (for now) | ||
|
||
h1. Paperclip S3 Storage | ||
|
||
This gem will force paperclip to store attachments on S3. It's great for "Heroku":http://heroku.com apps and thats basically why I wrote it. | ||
|
||
I was really lazy writing this over and over again, so I just gemed it. | ||
This gem will force paperclip to store attachments on S3 if your application is in production. It's great for "Heroku":http://heroku.com apps. | ||
|
||
h1. Important Notes | ||
|
||
If you're in fact using "Heroku":http://heroku.com, and you want the attachments to have custom paths. *PLEASE* do not use *RAILS_ROOT*. Why? Every time you deploy your app to "Heroku":http://heroku.com, you're changing the RAILS_ROOT, so all your uploaded files will be lost and your bucket *WILL* be a mess! | ||
|
||
A default, Heroku-working path is on by default, so you can just use it. | ||
|
||
h1. How to Use | ||
|
||
This gem will read your S3 credentials from the server's environment. You will need to provide a secret key, an access key and a bucket. (You can provide an *_s3_credentials_* hash options with *_access_key_id_* and *_secret_access_key_* instead.) | ||
|
||
If you are using "Heroku":http://heroku.com, it's really easy to do this, just | ||
|
||
<pre> | ||
heroku config:add S3_BUCKET=your_bucket_name | ||
heroku config:add S3_KEY=your_access_key | ||
heroku config:add S3_SECRET=your_secret_key | ||
</pre> | ||
|
||
Ok, if you're really lazy, you can do that in one line: | ||
|
||
<pre> | ||
heroku config:add S3_BUCKET=your_bucket_name S3_KEY=your_access_key S3_SECRET=your_secret_key | ||
</pre> | ||
|
||
After you've done this, you can use paperclip normally. The gem just extends this methods and changes the options to force the S3 Storage. You can *even* use the same options (like path, default_style, etc.) | ||
|
||
|
||
|
||
h2. Contribute | ||
|
||
Feel free to fork, fix/patch/extend this. Everything is welcome. | ||
Feel free to fork, fix/patch/extend this. Everything is welcome. | ||
|
||
h3. TODO | ||
|
||
* Clean the Railtie, specially the Rails.env part. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Paperclip | ||
module S3 | ||
VERSION = "1.0.0rc1" | ||
VERSION = "1.0.0" | ||
end | ||
end |