I put favicon.ico
into /public/
folder and include the following code into layout page
<%= favicon_link_tag %>
But inspite of it, the icon doesn't display. What should I do?
In this code favicon is a small image for a website that denotes the page Brand that can help to identify the original page. In other words, a favicon is a short icon or tab icon, or URL icon that contains 16x16 pixels or 32x32 pixels.
Favicon Optimization: Why Is It Crucial For SEO In 2022? A favicon is a small 16*16 pixel icon that serves as your website's branding. Its main purpose is to make it easier for visitors to find your page when they have multiple tabs open.
I have struggled with the same. This is what worked for me:
<%= favicon_link_tag 'favicon.ico' %>
and moving the favicon.ico
to the /public/images directory.
Good luck!
I don't know what favicon_link_tag
is in your app but in general, there are two ways to create a favicon.
/public
). In this case, you don't have to do anything in your code. (does not work in seamonkey, works in all other browsers I know)Place a link
element in the code of your master view:
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/relative/path/to/file.ico" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With