DEV Community

loading...
Cover image for How to Install FontAwesome with Yarn and Webpacker in Rails 6?

How to Install FontAwesome with Yarn and Webpacker in Rails 6?

yarotheslav profile image Yaroslav Shmarov Originally published at blog.corsego.com on ・1 min read

1. console:

yarn add @fortawesome/fontawesome-free

Enter fullscreen mode Exit fullscreen mode

2. javascript/packs/application.js:

import "@fortawesome/fontawesome-free/css/all"

Enter fullscreen mode Exit fullscreen mode

3. Check if it works:

Add couple of icons in any .html.erb (view) file:

<i class="far fa-address-book"></i>
<i class="fab fa-github"></i>

Enter fullscreen mode Exit fullscreen mode

That’s it!😊


Relevant links:

Discussion (2)

pic
Editor guide
Collapse
sasha370 profile image
Aleksandr Karyakin

В очередной раз, спасибо большое )

Collapse
jaemon profile image
Jonathan Owah

Thanks! Works perfectly.