6

My favicon just won't show, in Chrome or Firefox. This is how I am rendering it in the <head> section:

<%= favicon_link_tag 'favicon.ico' %>

It is located in public/images.

This is the produced HTML:

<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">

Opening the link in my browser shows the icon correctly.

dabadaba
  • 9,064
  • 21
  • 85
  • 155

1 Answers1

7

The favicon is not handled by the asset pipeline when its in the public folder, and this can cause caching problems.

See here: How to add favicon in rails 3.2 and Clear the cache from the Rails asset pipeline.

Use the favicon_link_tag and place the .ico file in /app/assets/images/ to get it into the asset pipeline.

If it still doesn't work after that, try clearing your browser cache, your rails cache, and restarting your rails server.

Community
  • 1
  • 1
Aaron Gray
  • 11,283
  • 7
  • 55
  • 61