-
-
Save raarellano/9474048 to your computer and use it in GitHub Desktop.
Paperclip configurations
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
rails g paperclip news_post image |
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
#Papercliip | |
config.paperclip_defaults = { | |
:storage => :s3, | |
:s3_credentials => Rails.root.join("config/s3.yml") | |
} |
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
$ heroku config:set AWS_BUCKET=your_bucket_name | |
$ heroku config:set AWS_ACCESS_KEY_ID=your_access_key_id | |
$ heroku config:set AWS_SECRET_ACCESS_KEY=your_secret_access_key |
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 | |
has_attached_file :thumb, styles: { | |
regular: "164X164#" | |
} | |
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
-if @news_post.image.file? | |
=image_tag(@news_post.image(:regular)) | |
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
#Papercliip | |
config.paperclip_defaults = { | |
:storage => :s3, | |
:s3_credentials => { | |
:bucket => ENV['AWS_BUCKET'], | |
:access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment