From 5ab0ffc6c8ae37d95b559ed0a9f2b926490e1d59 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 15 Apr 2017 02:07:21 +0200 Subject: Custom Paperclip path. (#778) * Custom Paperclip path. * Document PAPERCLIP_ROOT. * Add PAPERCLIP_ROOT_URL (and rename PAPERCLIP_ROOT to PAPERCLIP_ROOT_PATH). --- config/initializers/paperclip.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/initializers/paperclip.rb') diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index c58f1b06c..202c102c7 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -38,4 +38,7 @@ if ENV['S3_ENABLED'] == 'true' Paperclip::Attachment.default_options[:url] = ':s3_alias_url' Paperclip::Attachment.default_options[:s3_host_alias] = ENV['S3_CLOUDFRONT_HOST'] end +else + Paperclip::Attachment.default_options[:path] = (ENV['PAPERCLIP_ROOT_PATH'] || ':rails_root/public/system') + '/:class/:attachment/:id_partition/:style/:filename' + Paperclip::Attachment.default_options[:url] = (ENV['PAPERCLIP_ROOT_URL'] || '/system') + '/:class/:attachment/:id_partition/:style/:filename' end -- cgit