Created
April 16, 2016 11:01
-
-
Save tonkec/fd65151b5fc97ea91ba50e5c865c68bd 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
class AvatarUploader < CarrierWave::Uploader::Base | |
# Include RMagick or MiniMagick support: | |
# include CarrierWave::RMagick | |
include CarrierWave::MiniMagick | |
if Rails.env.production? | |
storage :fog | |
else | |
storage :file | |
end | |
end |
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
CarrierWave.configure do |config| | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
region: ENV['AWS_S3_REGION'], | |
path_style: true | |
} | |
config.fog_directory = ENV['S3_BUCKET_NAME'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment