2017-10-27 6 views
1

を使用したときに正しいURLが間違ったURLを提供する:http://s3.dvulgsolucoes.com.br/folder/filename.pngと私はこのURLを取得しています:http://s3.dvulgsolucoes.com.br.s3.amazonaws.com/folder/filename.pngペーパークリップはS3

config.paperclip_defaults = { 
    storage: :s3, 
    s3_credentials: { 
    bucket: 'bucketname.com.br', 
    access_key_id: '###', 
    secret_access_key: '###', 
    } 
} 

Paperclip::Attachment.default_options[:url] = ':s3_domain_url' 
Paperclip::Attachment.default_options[:path] = '/clients/dmg/:class/:attachment/:id_partition/:style/:filename' 

答えて

0

あなたはイニシャライザにpaperclip.rbを編集し、クリップからデフォルトのURLとパスを変更することができます。

Paperclip::Attachment.default_options[:url] = ':s3_domain_url' 
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' 

あなたはHerokuの

https://devcenter.heroku.com/articles/paperclip-s3#configuration

から、このリンクをチェックすることができます
関連する問題