css - Rails Bootstrap glyphicons -
so have been having lot of issues getting bootstraps glyphicons
working. have been able them show on site. problem having, following errors in dom:
get http://localhost:3000/fonts/glyphicons-halflings-regular.woff2 jquery.self-660adc5….js?body=1:3734 http://localhost:3000/fonts/glyphicons-halflings-regular.woff localhost/:1 http://localhost:3000/fonts/glyphicons-halflings-regular.ttf 404 (not found) localhost/:1
just aware, when select jquery.self-660adc5...js?body=1:3734
taken following line of code: support.inlineblockneedslayout = val = div.offsetwidth === 3;
in terminal following:
started "/fonts/glyphicons-halflings-regular.woff2" ::1 @ 2016-04-18 21:57:17 -0600 actioncontroller::routingerror (no route matches [get] "/fonts/glyphicons-halflings-regular.woff2")
i have bootstrap glyphicon files in vendor/assets/fonts/
glyphicons-halflings-regular.eot glyphicons-halflings-regular.woff glyphicons-halflings-regular.svg glyphicons-halflings-regular.woff2 glyphicons-halflings-regular.ttf
in application.css
folder have:
@import "bootstrap-sprockets"; @import "bootstrap"; @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'); }
in application.rb
config.assets.paths << "#{rails}/vendor/assets/fonts" config.assets.precompile += %w(.svg .eot .woff .ttf .woff2)
in mime_types.rb
rack::mime::mime_types['.woff'] = 'application/x-font-woff'
i guess confused glyphicons
showing , working, however, still getting error in dom in terminal these files cannot found. suggestions on how can handle this? had gem 'bootstrap-sass', '3.2.0.0'
installed dl'd bootstrap package , added project.
unfortunately have yet resolve issue. have included bootstrap cdn keys:
<!-- latest compiled , minified css --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <!-- jquery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <!-- latest compiled javascript --> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
this removes errors now. if else has solution or needs more information on how solve issue please comment. eager hear thoughts.
you still need add woff2
files asset pipeline:
config.assets.precompile += %w(.svg .eot .woff .woff2 .ttf)
Comments
Post a Comment