Search code examples
cssruby-on-railstwitter-bootstrapglyphiconstwitter-bootstrap-2

What is the proper file path for Bootstrap 2.3.2 Glyphicons?


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?


Solution

  • 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