设置桶的名字放在域样式(bucket.s3.amazonaws.com)与Rails和回形针 [英] Setting up bucket's name placed domain-style (bucket.s3.amazonaws.com) with Rails and Paperclip

查看:252
本文介绍了设置桶的名字放在域样式(bucket.s3.amazonaws.com)与Rails和回形针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回形针商务部关于URL选项:

Paperclip doc about url options:

您可以选择让桶的名字放在域样式(bucket.s3.amazonaws.com)或路径式(s3.amazonaws.com/bucket)。

You can choose to have the bucket's name placed domain-style (bucket.s3.amazonaws.com) or path-style (s3.amazonaws.com/bucket).

如何将看起来像设置实际上有斗的名字放在域样式?我不能强迫回形针生成URL像bucket.s3.amazonaws.com而不是s3.amazonaws.com/bucket。

How would look like the setup to actually have bucket's name placed domain-style? I can't force paperclip to generate urls like bucket.s3.amazonaws.com instead of s3.amazonaws.com/bucket.

推荐答案

刚刚成立这样的:

Paperclip::Attachment.default_options[:url] = ':s3_domain_url'

或者是这样的:

Or like this:

Paperclip::Attachment.default_options.merge!(
  :url => ':s3_domain_url'
)

这篇关于设置桶的名字放在域样式(bucket.s3.amazonaws.com)与Rails和回形针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆