How to Add a Favicon to Your Rails App

Because I forget every time I go to do it

Joe Cardillo
Jun 5, 2018
Photo by Ozgu Ozden on Unsplash

You created a Rails application that executes perfectly. All the routes are golden. The styling is crisp. Then you look at your tabs and realize something vital is missing.

Where’s the favicon?!

To add a favicon to your Rails app

  1. Save the image to your assets folder:

2. Open your views/layouts/application.html.erb file.

3. Add <%= favicon_link_tag asset_path('image-name.png') %>

4. Single or double fist-pump.

There it is!

--

--