The docs say:
Asset Management Assistants . When using the asset pipeline, you must rewrite the paths to the assets. When referencing assets, use the following asset helpers (underlined in Ruby, hyphens in Sass):
◦ asset_path($relative-asset-path, $asset-class) - Returns a string to the asset. For example: asset-path("rails.png", image) becomes "/assets/rails.png" ◦ asset_url($relative-asset-path, $asset-class) - Returns url reference to the asset.
For example: asset-url ("rails.png", image) becomes url (/assets/rails.png)
As a convenience for each of the following asset classes, there are corresponding -path and -url helpers: image, font, video, audio, javascript, style sheet. For example: image-url ("rails.png") becomes url (/assets/rails.png), and the image path ("rails.png") becomes "/assets/rails.png".
Example:
@font-face font-family: HelveticaInseratCom src: font-url('HelveticaInseratCom.ttf')
But I could not do this for my rails3.1 application. I had to put the fonts directly in the shared folder:
/public/HelveticaInseratCom.ttf
And in the css.scss.erb file I used:
@font-face font-family: HelveticaInseratCom src: url('/HelveticaInseratCom.ttf')
Then it worked, and when rake assets:precompile started rake assets:precompile worked without throwing this error:
rake aborted! HelveticaInseratCom.ttf isn't precompiled