Topic: Getting favicon.ico to appear on Firefox, Safari and IE

I have created a 16x16 Windows Icon format image file and replaced the empty myproj/public/favicon.ico with my new favicon.ico.  I am able to see this properly within Safari, but it does not appear on Firefox or IE, just the generic one from the browser.

This most likely is not a rails issue, but happens to be how I am serving up my content.  Any ideas?

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Try adding

<link rel="shortcut icon" href="/favicon.ico" />

inside the <head> tag

Railscasts - Free Ruby on Rails Screencasts

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Thanks a lot mr Ryan !it was very useful

Re: Getting favicon.ico to appear on Firefox, Safari and IE

It's probably not that but it may just be old browser cache -- I find favicons take a little longer to refresh than standard web page browser cache, so I would refresh it a few more times to see if it still doesn't work.

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Great, I was just wondering the same thing

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Hi all,
what would be the correct for to this when your application is deployed to a subdirectory, say
http://mydomain.com/myapp?

The two ways I've found are either using an absolute path in the link tag

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

or setting the env variable in environment.rb

RAILS_RELATIVE_URL_ROOT = '/myapp'

Any advice on how to get the correct url of the static resources in public and public/images when deploying to a subdirectory?

Thanks,

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Hi,

In firefox browser it's working fine. But in Google Chrome I didn't get the favicon. How to make visible in all browsers.

Re: Getting favicon.ico to appear on Firefox, Safari and IE

Yes, Ryan is right, but you put your favicon the true path. On the other hand, you can delete your browser cash to see your favicon on your browsers.

life is not short however you think to learn Rails