【问题标题】:How to point image-path scss helper to relative URL如何将图像路径 scss 助手指向相对 URL
【发布时间】:2012-02-21 15:25:06
【问题描述】:

我的应用的生产实例在相对 URL 上运行:http://server/app_domain/

image-path scss 助手指向/assets/image1234.png 解析为

http://server/assets/image1234.png

而不是

http://server/app_domain/assets/image1234.png

是否有任何配置来设置应用程序的根 url?我希望图像路径生成../assets/image1234.png/app_domain/assets/image1234.png

我正在使用 JRuby/warbler/JBoss 进行 prod/uat 部署。

谢谢

【问题讨论】:

    标签: ruby-on-rails jruby warbler


    【解决方案1】:

    config/environments/production.rb 中,您可以设置所有资产助手中正在使用的资产主机。

    config.action_controller.asset_host = "http://server/app_domain/"
    

    这将为您提供绝对网址,但您需要的方式。

    【讨论】:

      猜你喜欢
      • 2018-11-05
      • 2014-10-10
      • 2020-01-15
      • 2011-05-12
      • 2016-10-28
      • 2012-01-02
      • 2020-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多