seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 996 forks source link

No route matches [GET] "/assets/fonts/glyphicons-halflings-regular.woff2" #927

Open slhck opened 6 years ago

slhck commented 6 years ago

I am using version 4.0.0 with Rails 5.1.4 and have Glyphicons enabled in the bootstrap_and_overrides.css.less file:

@import "twitter/bootstrap/bootstrap";

// Glyphicons are not required by default, uncomment the following lines to enable them.
@glyphiconsEotPath: font-url("glyphicons-halflings-regular.eot");
@glyphiconsEotPath_iefix: font-url("glyphicons-halflings-regular.eot?#iefix");
@glyphiconsWoffPath: font-url("glyphicons-halflings-regular.woff");
@glyphiconsTtfPath: font-url("glyphicons-halflings-regular.ttf");
@glyphiconsSvgPath: font-url("glyphicons-halflings-regular.svg#glyphicons_halflingsregular");

@import "twitter/bootstrap/glyphicons.less";

However the path loaded from the generated CSS is not correct:

No route matches [GET] "/assets/fonts/glyphicons-halflings-regular.woff2"

When I add this code (which I found here) to the bootstrap_and_overrides.css.less, it works:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('/assets/glyphicons-halflings-regular.eot');
  src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/assets/glyphicons-halflings-regular.woff') format('woff'), url('/assets/glyphicons-halflings-regular.ttf') format('truetype'), url('/assets/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

Clearly, this is a hack. What would be the proper solution?

PS: This is in the development environment.