Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely
-
Download the bootstrap-glyphicons.css from here. Save that file to
RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css
-
Save all the font files in
/dist/fonts
from the Bootstrap 3.0 download to a new folder in your Rails appRAILS_ROOT/vendor/assets/fonts
-
Add this folder to the asset pipeline by appending
config.assets.paths << Rails.root.join("vendor","assets", "fonts")
toapplication.rb
after the line that hasclass Application < Rails::Application
. -
In
bootstrap-glyphicons.css
modify the theurl
paths in@font-face
to read/assets/FILE_NAME
instead of../fonts/FILE_NAME
Example:
src:url('../fonts/glyphicons-halflings-regular.eot');
becomes
src:url('/assets/glyphicons-halflings-regular.eot');
There are only about 5 times in the file where you have to do this and they are all on the same line (~ line 63).
-
Beer me.
Now you can kick icons around like you're Messi or something. Try adding <span class="glyphicon glyphicon-search"></span>
to an html page and bask in the glory of icons. Or don't. Your call.
It works!
By far, this was the best and easiest way to add those nice Glyphicons to a rail app.
Thank you very much!