LoginSignup
8
11

More than 5 years have passed since last update.

マテリアルアイコンをRuby on Railsで使う

Last updated at Posted at 2017-05-30

使うもの

準備

Gemのインストール

Gemfileに下記2行を追加

gem 'materialize-sass'
gem 'material_icons'

bundle installする

scssに追加

app/assets/stylesheets/application.scssに下記1行を追加

@import "materialize/components/icons-material-design";

使い方

HTMLタグを使う方法

<i class="material-icons">face</i>
<i class="material-icons md-36">face</i>

ヘルパーを使う方法

<%= material_icon.face %>
<%= mi.face %>

参考

MATERIAL DESIGN ICONS
Material Icons Guide
Materialize Icons
0から分かるマテリアルデザインの作り方
マテリアルデザインについて少し調べる

8
11
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
8
11