E
E
eldar_web2015-11-06 14:38:55
Ruby on Rails
eldar_web, 2015-11-06 14:38:55

How to connect to a font in Ruby on Rails by creating a fonts folder?

I want to add a font.
Created a fonts/ folder in app/assets/ and uploaded the font here.
And I connect like this:
...
src: url(fonts/rouble.ttf);
...
And the font is not connected. Did I set the path correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zaporozhchenko Oleg, 2015-11-07
@eldar_web

The answer you provided is not entirely correct. When deployed to the server, assets with digests are generated.
Correct:
src: font -url(rouble.ttf);

S
snowacat, 2015-11-11
@snowacat

Add your folder to application.rb:
config.assets.paths << Rails.root.join("app", "assets", "fonts")
You can now use fonts from the fonts folder like this:
font-url('HelveticaNeue.eot ');
They will be available.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question