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

Asked

Viewed 4,028 times

1

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

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

Everything works perfectly with the exception of Glyphicons.

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

Glyphicon

Below the Firefox console print:

inserir a descrição da imagem aqui

Here is the section 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');
}

1 answer

2


no secret is just put the css in the location you want and the images in a folder.

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

  • 1

    Now I got it: I put the fonts and pointed to the folder public instead of the folder app/assets.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.