now using fog for cloud storage (s3)
This commit is contained in:
parent
5fb0b945cc
commit
5da472e772
|
@ -8,7 +8,7 @@ class FileUploader < CarrierWave::Uploader::Base
|
|||
include CarrierWave::MiniMagick
|
||||
# Choose what kind of storage to use for this uploader
|
||||
if ENV['S3_KEY']
|
||||
storage :s3
|
||||
storage :fog
|
||||
|
||||
def cache_dir
|
||||
"#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true'
|
||||
|
|
|
@ -11,4 +11,4 @@
|
|||
<%= form.label :description %><br />
|
||||
<%= form.text_area :description %><br />
|
||||
<br/>
|
||||
<p>On disk: ~/<%= @photo.file.file.file %></p>
|
||||
<p>On disk: ~/<%= @photo.file.path %></p>
|
|
@ -1,5 +1,9 @@
|
|||
CarrierWave.configure do |config|
|
||||
config.s3_access_key_id = ENV['S3_KEY']
|
||||
config.s3_secret_access_key = ENV['S3_SECRET']
|
||||
config.s3_bucket = ENV['S3_BUCKET']
|
||||
end
|
||||
config.fog_credentials = {
|
||||
:provider => 'AWS',
|
||||
:aws_access_key_id => ENV['S3_KEY'],
|
||||
:aws_secret_access_key => ENV['S3_SECRET'],
|
||||
:region => 'us-east-1'
|
||||
}
|
||||
config.fog_directory = ENV['S3_BUCKET']
|
||||
end
|
Loading…
Reference in a new issue