Rails 4 favicon issue

Trying to add a favicon to my rails app, but doesn't seem to be working locally. Heres my code

Aplication.html.erb (in the head section)

<%= favicon_link_tag '/favicon.ico' %>

Note: Favicon has been saved within my asset/images folder and the icon is 64x64 pixel

Is there anything thats been done wrong here?

Thanks in advance

Answers


I think the address should be without the slash:

<%= favicon_link_tag 'favicon.ico' %>

The proper use of favicon_link_tag is the immediate solution:

<%= favicon_link_tag 'favicon.ico' %>

However, a single favicon.ico can only address most desktop browsers. Mobile browsers can't cope with it but need higher resolution icons, like the Touch icon for iOS devices. You can get support for all browsers with RealFaviconGenerator:

  • Go to RealFaviconGenerator and submit your picture. You can edit your icons platform-per-platform (Android, iOS...).
  • When the icons are ready, follow the instructions.

The instructions are clear enough to setup the favicon, so there will be no path issue, no "extra slash" issue, etc.

Full disclosure: I'm the author of this site.


Using rails 4.2.3, in my /public folder there was already a favicon. I simply replaced that and DID NOT ADD <%= favicon_link_tag 'favicon.ico' %>. Worked perfectly.

Weird thing is I first tried with the favicon_link_tag and that somehow prevented the favicon from showing up.


The proper use of favicon: add this <%= favicon_link_tag(source='favicon.ico')%>


Need Your Help

When should I use a List vs a LinkedList

c# .net vb.net data-structures linked-list

When is it better to use a List vs a LinkedList?

In bash, how do I count the number of lines in a variable?

bash string

I have a variable which has a string stored in it and need to check if it has lines in it: