Ruby on Rails Bootstrap Glyphicons not working

后端 未结 17 2081
Happy的楠姐
Happy的楠姐 2020-12-02 07:43

I have added bootstrap to my site. Here is the structure I am using. (I cannot whatsoever remove the bootstrap.css file since it I modified it to my liking).



        
17条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 08:39

    I was also struggling to make boostrap3 glyphicon work in rails 4. I solved it by adding

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

    to application.css.scss file and

    config.assets.paths << "#{Rails}/vendor/assets/fonts"
    

    to application.rb file.

提交回复
热议问题