0
0

More than 3 years have passed since last update.

【Rails】FontAwesome

Last updated at Posted at 2020-01-09

準備

Gemfileに
gem 'font-awesome-rails'を記載。
ターミナルでbundle installを実行。

ターミナル
bundle install

application.css*= require font-awesomeを記載。

app/assets/stylesheets/application.css

/*
(省略)
 *= require font-awesome
(省略)
 */

使い方

<i class="fa fa-home"></i>

ヘルパーメソッドを使用できるので
<%= fa_icon("home") %>
と書くこともできる。

例えば
<%= fa_icon("home 5x") %>
で5倍。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0