Paperclip CloudFiles?
-
17-02-2021 - |
Question
How can I use Paperclip with CloudFiles? I found paperclip-cloudfiles, but in the description it says it will probably be removed and the last commit was in 2010.
Solution
Gemfile:
gem 'fog'
config/environments/production.rb
Paperclip::Attachment.default_options.update({
:path => ":picturable_name/:basename_:style.:extension",
:storage => :fog,
:fog_credentials => {
:provider => 'Rackspace',
:rackspace_username => RACKSPACE_USERNAME,
:rackspace_api_key => RACKSPACE_API_KEY,
:persistent => false
},
:fog_directory => CONTAINER_NAME,
:fog_public => true
})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow