Skip to content
Todd Baur edited this page Feb 13, 2015 · 4 revisions

FontAwesome is included in railsstrap. In order to get rails to serve the font files, you'll need to verify that bundle exec rails g railsstrap:install configured rails for you. Below is the changes that the install process automates.

Import FontAwesome CSS

(all rails versions)

@import 'fontawesome'

Will give you font awesome hosted by a CDN by default.

If you want to host the files yourself, you'll need to add some more configuration for your app. Add -local to your import statement:

@import 'fontawesome-local'

Rails 3.1+

Open config/application.rb (or config/environments/production.rb)

# Enable the asset pipeline
config.assets.enabled = true
config.assets.precompile\s+=\s%w(fontawesome/fonts/fontawesome-webfont.eot fontawesome/fonts/fontawesome-webfont.woff fontawesome/fonts/fontawesome-webfont.ttf fontawesome/fonts/fontawesome-webfont.svg)
```

### Rails 4.0+

Open config/initializers/assets.rb
```
Rails.application.config.assets.precompile += %w( fontawesome/fonts/fontawesome-webfont.eot fontawesome/fonts/fontawesome-webfont.woff fontawesome/fonts/fontawesome-webfont.ttf fontawesome/fonts/fontawesome-webfont.svg )
```