【发布时间】:2014-06-18 19:21:10
【问题描述】:
我使用 Amazon S3 进行文件上传,使用 Cloudfront 提供静态资产,在我的 config/environments/staging.rb 中,我写道
ActionController::Base.asset_host = Proc.new { |source|
if source.include?('/assets')
"d1xw0c7m8has5k.cloudfront.net"
else
"#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end
}
ActionMailer::Base.asset_host = Proc.new { |source|
if source.include?('/assets')
"d1xw0c7m8has5k.cloudfront.net"
else
"#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end
}
但在我通过 Rails 应用程序发送的邮件中,我看到 image_tag src 属性为空?
即不显示图像。
我无法识别此设置有什么问题,请帮忙。
【问题讨论】:
标签: ruby-on-rails-4 amazon-s3 actionmailer amazon-cloudfront ruby-2.1