How to include Bootstrap source files (Glyphicons) in Rails?

1

In my Rails applications I usually include Bootstrap manually in folders:

  • app/assets/stylesheets/lib (CSS) and
  • app/assets/javascripts/lib (Javascript)

Everything works perfectly except for Glyphicons .

I put the font files in the app/assets/fonts folder but it does not recognize them. HTML <span class="glyphicon glyphicon-search"></span> generates the following symbol:

  

BelowtheFirefoxconsoleprint:

Here is the snippet that contains the URLs (unchanged):

@font-face {
  font-family: 'Glyphicons Halflings';

  src: url('../fonts/glyphicons-halflings-regular.eot');
  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
    
asked by anonymous 19.05.2014 / 14:24

1 answer

2

There's no secret, just put the css wherever you want and the images in a folder.

Check the configuration in the css to see if you are finding the path of the images and ready without a secret.

    
19.05.2014 / 14:42