供应商/资产样式表如何找到vendor / img图像

时间:2013-07-24 14:39:06

标签: ruby-on-rails

Bbootstrap.css在vendor / assets / stylesheets /里面,在bootstrap.css里面,就是这一行,

dropdown-submenu:focus > a > [class*=" icon-"] {
  background-image: url("../images/glyphicons-halflings-white.png");
}

然而,我的ruby on rails app正在抱怨

GET http://localhost:3000/images/glyphicons_halflings-white.svg 404 (Not found)

如何找到它? glyphicons_halflings-white.svg在vendor / assets / img

1 个答案:

答案 0 :(得分:1)

在样式表中使用image-url,Rails将确保使用正确的路径。如果您不使用该助手,则在使用资产指纹识别时,您将只有生产中的图像损坏。

在这种情况下,正确的网址为/assets/glyphicons_halflings-white.svg。但是,再一次,生产中不会出现这种情况。

相关问题