I want to use a little icon in Rails

Introduction

I wanted to design it a little fashionably, so I tried using the icon. Font Awesome There are many icons that you can use for free. It can also be used with Rails.

Preparation until it can be used

1. Write Gem

Gemfile


gem 'font-awesome-rails'

Add to the bottom of the file.

2. Installation

At the terminal

bundle install

3. Load it for use in view files

ruby:app/views/layouts/application.html.erb


<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.9.0/css/all.css">

Describe in the <head> tag.

How to use

Select the icon you want to use from Official Site and select it.

<i class="fa fa-Icon name"></i>

It can also be used with helper methods.

Recommended Posts

I want to use a little icon in Rails
I want to define a function in Rails Console
I want to use @Autowired in Servlet
I want to use arrow notation in Ruby
[Rails] I want to send data of different models in a form
I want to use Clojure's convenient functions in Kotlin
I want to use fish shell in Laradock too! !!
I want to use ES2015 in Java too! → (´ ・ ω ・ `)
I want to click a GoogleMap pin in RSpec
I want to use FormObject well
I want to find a relative path in a situation using Path
I want to create a form to select the [Rails] category
A story I was addicted to in Rails validation settings
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I want to create a Parquet file even in Ruby
I want to use FireBase to display a timeline like Twitter
I want to use PowerMock in a class that combines parameterized tests and ordinary tests
[Rails] I want to display the link destination of link_to in a separate tab
I want to develop a web application!
I want to write a nice build.gradle
I want to add a browsing function with ruby on rails
I want to use swipeback on a screen that uses XLPagerTabStrip
How to insert a video in Rails
I want to use DBViewer with Eclipse 2018-12! !!
[Ruby] I want to put an array in a variable. I want to convert to an array
I want to write a unit test!
How to use MySQL in Rails tutorial
Steps to set a favicon in Rails
I want to add devise in Rails, but I can't bundle install
How to use credentials.yml.enc introduced in Rails 5.2
I want to select multiple items with a custom layout in Dialog
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (PowerMockito edition)
I was a little addicted to running old Ruby environment and old Rails
I want to display a PDF in Chinese (Korean) with thin reports
I want to ForEach an array with a Lambda expression in Java
[Java Spring MVC] I want to use DI in my own class
"Teacher, I want to implement a login function in Spring" ① Hello World
Convert to a tag to URL string in Rails
I want to send an email in Java.
I tried to organize the session in Rails
[Rails] How to use select boxes in Ransack
Add a tag function to Rails. Use acts-as-taggable-on
[Ruby] I want to do a method jump!
I want to use java8 forEach with index
I want to pass APP_HOME to logback in Gradle
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
I want to simply write a repeating string
I want to design a structured exception handling
rsync4j --I want to touch rsync in Java.
How to implement a like feature in Rails
How to easily create a pull-down in Rails
I want to play with Firestore from Rails
[Xcode] I want to manage images in folders
How to use JQuery in js.erb of Rails6
I want to be eventually even in kotlin
How to make a follow function in Rails
[Rails] How to use PostgreSQL in Vagrant environment
[Rails] I want to load CSS with webpacker
I want to get the value in Ruby
Use images in Rails
[Rails + Webpacker] I want to use images of assets! Until you can view the image in Vue.js