I've beens searching around, and I see a ton of different proposed file paths, none of which work for me.

What do I change background-image: url("/../img/glyphicons-halflings.png"); to?

有帮助吗?

解决方案

In short, if you use Rails assets pipeline all your assets will be compiled to /assets folder. There is also an option to change the folder name. Please refer to the guide for more details.

If you use scss with sass-rails gem there are helper methods asset-url and image-url that can help you manage with assets path for your CSS.

Lastly there are a couple gems you can use to include bootstrap in your Rails app:

https://github.com/seyhunak/twitter-bootstrap-rails is a less version (Bootstrap is built with less). It requires less-rails gem and https://github.com/thomas-mcdonald/bootstrap-sass

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top