开发者

Override an asset host in rails, via the helper methods?

开发者 https://www.devze.com 2023-03-13 15:08 出处:网络
I was wondering if there was a way to override the asset host of an image. For example lets say I have the following asset host and image tag

I was wondering if there was a way to override the asset host of an image.

For example lets say I have the following asset host and image tag

config.asset_host = "www.xxx.com
image_tag "blerg.gif"

This would out put and image tag with the sc开发者_Go百科r:

www.xxx.com/blerg.gif

Is there a way to change the asset host inline for example:

image_tag "blerg.gif", :host => 'www.yyy.com

Which would change the asset host of the image.

Cheers.


You can pass your full url: image_tag "http://www.yyy.com/blerg.gif"

0

精彩评论

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

关注公众号