1

Possible Duplicate:
Rails: Using Font Awesome

I have Rails app in which I'm using many twitter-bootstrap's icon.

For that I did put "boostrap.css.erb" in /assets/stylesheets/ folder directly
also "glyphicons-halflings-white.png" and "glyphicons-halflings.png" in /assets/images/ folder directly.

Now I just downloaded Font awesome and extracted.
I'm guessing I have to do something with these files. Can anyone tell me how to set up?

/css/ folder

  • font-awesome-ie7.min.css
  • font-awesome.css
  • font-awesome.min.css

/font/ folder

  • fontawesome-webfont.eot
  • fontawesome-webfont.svg
  • fontawesome-webfont.ttf
  • fontawesome-webfont.woff
  • FontAwesome.otf
Community
  • 1
  • 1
HUSTEN
  • 5,117
  • 4
  • 24
  • 38

1 Answers1

1

Easy, just add your stylesheets to the head section of your html

    <link href="css/font-awesome.css" rel="stylesheet">
    <!--[if IE 7]>
    <link href="css/font-awesome-ie7.css" rel="stylesheet">
    <![endif]-->

And make sure you put all the font files in the same folder (I used /css as an example). Then to use the icons on a page, just do

<span class='icon-star'></span> 

(that inserts the icon using the css in the font-awesome.css file. Check there for all the possible classes. There's a bunch like icon-gear, icon-star, etc)

HTMLGuy
  • 245
  • 2
  • 17
  • Thanks for the answer but the problem is that I'm using rails. It has its own convention and it's not piece of cake – HUSTEN Jan 23 '13 at 06:11
  • Sorry I misunderstood. I was under the assumption Rails was a backend scripting language and still used html/css for the front-end..... – HTMLGuy Jan 23 '13 at 06:14
  • 3
    http://stackoverflow.com/questions/11052398/rails-using-font-awesome – HTMLGuy Jan 23 '13 at 06:14
  • http://stackoverflow.com/questions/12253146/font-face-rails-3-2/12253606#12253606 – Richlewis Jan 23 '13 at 17:14
  • Follow the instruction: http://stackoverflow.com/questions/21772507/ruby-not-load-font-awesome – Tarique May 22 '15 at 19:13