1

I'm trying to import icons from Flaticon in my Rails app. They have a small tutorial for basic website (only HTML + CSS) but I can't integrate it into my app rails.

I don't want to import them as classic picture but as elements <i class></i> (like Font Awesome) in order to be able to modify the style in css later.

The tutorial => https://www.flaticon.com/iconfonts

The Key question for me is where I must put the Flaticon files in my rails app? In stylesheets?

For now, I only succeeded to have little square, instead of icons.

Have someone here already used Flaticon Icon Fonts tutorial to import custom icons in his Rails app ?

Thanks in Advance ;)

Matt from Paris

Sean
  • 6,873
  • 4
  • 21
  • 46
Matt
  • 11
  • 1

1 Answers1

0

You have to do the followings.

  1. add flaticon font files (eot, ttf, svg, woff) to vendor/assets/fonts
  2. configure asset pipepline to use fonts
  3. add flaticon css file to vendor/assets/stylesheets
  4. import flaticon css in application.{scss|sass|css}
  5. restart server

Details for above two steps can be found in this answer.

If it still doesn't work you have to look into the flatfile css file (for reference of font-file by path).

And you should read Rails Guide Asset Pipeline.

Tun
  • 1,345
  • 13
  • 34