0

I have followed the instructions from font awesome guide at http://fortawesome.github.io/Font-Awesome/get-started/ but the font doesn't appear to my html.erb page, instead it shows weird symbols.

Jason
  • 15,017
  • 23
  • 85
  • 116

3 Answers3

1

Personally I like the font-awesome-rails gem best. It integrates FA into the asset pipeline and adds a fa_icon helper that you can use in your views.

Marcus Ilgner
  • 6,935
  • 2
  • 30
  • 44
0

What code are you using for your classes? You need to use 'fa', not 'icon' e.g.

class="fa fa-plus"
margo
  • 2,927
  • 1
  • 14
  • 31
0

in your config/initializers/assets.rb add next strings:

Rails.application.config.assets.precompile += %w( fontawesome-webfont.eot )
Rails.application.config.assets.precompile += %w( fontawesome-webfont.woff2 )
Rails.application.config.assets.precompile += %w( fontawesome-webfont.woff )
Rails.application.config.assets.precompile += %w( fontawesome-webfont.ttf )
Rails.application.config.assets.precompile += %w( fontawesome-webfont.svg )

in your app/assets/stylesheets/application.css add

*= require font-awesome
Igor Ivancha
  • 3,413
  • 4
  • 30
  • 39