Favicon.ico not showing (Rails)

667 views Asked by At

This feels like an extremely silly problem, and yet I haven't been able to solve it - despite much searching.

I'm trying to get my Rails app to display a favicon, and I can't seem to get it working.

I've tried placing a basic 16x16 favicon.ico image in my public folder, as well as the assets/images folder.

I've been using the following code in my layouts/application.html.erb file, within the head

<%= favicon_link_tag "favicon.ico" %>

When my site loads, I can see the following being displayed in the html upon inspecting the page, but I cannot see the favicon.

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

Things I have tried to solve this include:

1) Changing my code to "/favicon.ico", or removing the explicit link entirely.

2) Clearing the cache multiple times, and trying multiple browsers

3) Placing the favicon.ico file in multiple locations (as mentioned, I've tried it both in /public and in the asset pipeline)

4) Loading my local environment from a different port

But no luck so far, despite these efforts. What else could I be doing wrong here? I assume it's blindingly obvious, but none of the other answers on the topic have worked for me.

0

There are 0 answers