Neil Middleton

github twitter work

Using webfonts in the asset pipeline

Now that we have the asset pipeline, you need to include your fonts in a slightly different way.

All assets inside /app/assets fonts, images, audios, javascripts and stylesheets are included, but to get the appropriate links in your CSS etc you need to use

asset-url("my-webfont.eot", font);

However, before this will work, you'll need sass-rails in your Gemfile:

gem 'sass-rails'

Once this is done, you should see proper url() declarations appearing in your CSS.

For more info on the asset pipeline, read the Rails Guide.

blog comments powered by Disqus