It's perfectly working in development, but not in production. It's not finding the following files:
/assets/fontello.woff
/assets/fontello.ttf
Here is the setup:
assets.rb
Rails.application.config.assets.paths << Rails.root.join('app', 'vendor', 'assets', 'fonts')
Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
fontello.css
@font-face {
font-family: 'fontello';
src: url('/assets/fontello.eot');
src: url('/assets/fontello.eot#iefix') format('embedded-opentype'),
url('/assets/fontello.woff') format('woff'),
url('/assets/fontello.ttf') format('truetype'),
url('/assets/fontello.svg#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
As I said, everything is working fine in development. I have try a lot of things. For example:
add the following line in the assets.rb
:
Rails.application.config.assets.precompile += [/^[-_a-zA-Z0-9]*\..*/]
but nothing worked.
Could you advise anything else to try?
What does ls public/assets
outputs in production?
Probably your files are there with a digest (ex. fontello-XXXX.ttf
). In this case you have to use the font helpers in your sass (not css) - ex. in your font-family block: src:font-url('fontello.ttf')