开发者

Rails3 mailer with image_tag ignoring host

开发者 https://www.devze.com 2023-02-16 18:26 出处:网络
I\'ve got a Rails3 mailer layout that include images. This ones are used like : image_tag(\"emails/top.gif\", :width => \"700\", :height => \"10\", :alt => \"\")

I've got a Rails3 mailer layout that include images.

This ones are used like :

image_tag("emails/top.gif", :width => "700", :height => "10", :alt => "")

As of Rails 2, this images included the host and produced the expected result. However, since Rails3 the config.action_mailer.default_url_options seems to be ignored.

Is the开发者_JAVA百科re anything I'm missing?

Update

my config/environment/development.rb include:

config.action_mailer.default_url_options = { :host => 'mydomain.tld' }


Needs to use config.action_mailer.asset_host = 'http://mysite.com' in your environment config file

Credits: wmoxam in #rubyonrails

0

精彩评论

暂无评论...
验证码 换一张
取 消