Reputation: 77
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.
Upvotes: 0
Views: 436
Reputation: 3451
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
Upvotes: 0
Reputation: 7211
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.
Upvotes: 1
Reputation: 2927
What code are you using for your classes? You need to use 'fa', not 'icon' e.g.
class="fa fa-plus"
Upvotes: 0