John
John

Reputation: 4382

Adding Fonts to asset pipeline

I've read several stackoverflow questions about the issue, but none seem to work for me. My environment is Rails 3.1.6, Ruby 1.9.3, sass-rails 3.1.0.

I'm trying to add fonts to vendor/assets/fonts. When I add the font files (example: 1eaf27c0-f4de-4273-9f4c-1b3236ad2f3c.woff) to that directory and restart the server. If I go to localhost:3000/assets/1eaf27c0-f4de-4273-9f4c-1b3236ad2f3c.woff, I get a 404.

Any ideas why this is happening? I have tried adding

config.assets.paths << "#{Rails.root}/vendor/assets/fonts"

to application.rb with it still not working.

Upvotes: 4

Views: 1661

Answers (1)

John
John

Reputation: 4382

Turns out the font name can't have a hyphen. I'm guessing this has to do with the fact that file fingerprinting uses hyphens. It works when I remove the hyphen

Upvotes: 6

Related Questions