From ec43fb73ed450ac6a0d78b5d98284ef1f8e08ef4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 6 Nov 2016 18:55:20 +0100 Subject: [PATCH] Improve S3 config --- config/initializers/paperclip.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 73eb3356bc..d727612507 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -7,4 +7,7 @@ if ENV['S3_ENABLED'] == 'true' secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), s3_region: ENV.fetch('S3_REGION') } + + Paperclip::Attachment.default_options[:url] = ':s3_domain_url' + Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' end