Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon with Rails 3.1 not showing up? [duplicate]

I can't get my favicon to show up. It's called favicon.ico and inside of public directory (folder). My development log shows no problems with the favicon. I put the link in my application layout:

<!DOCTYPE html>
<html>
    <head>
        <%= csrf_meta_tag %>
        <%= favicon_link_tag "/favicon.ico" %>
        <%= stylesheet_link_tag "application" %>
        <%= javascript_include_tag "application" %>
    </head>
    <body>
        <%= yield %>
    </body>
</html>

But its still not showing up in Firefox. I cleared my cache with Firefox and I also tried <%= favicon_link_tag %> too. I haven't tried production but can you even see it in localhost? What am I missing?

UPDATE

So its showing up in Chrome but not Firefox. Any idea why?

like image 748
LearningRoR Avatar asked Apr 29 '12 04:04

LearningRoR


2 Answers

If you suspect caching is the problem, you could also trick the browser into loading the new icon by adding a parameter to the filepath.

Instead of

favicon_link_tag "/favicon.ico"

Use

favicon_link_tag "/favicon.ico?1"

like image 65
Tyler Johnson Avatar answered Nov 07 '22 15:11

Tyler Johnson


Clear the cache again in Firefox (I usually just clear everything) and then check out the network traffic when you load your page. Make sure that favicon.ico is being requested. If not, then it's probably being cached somewhere. I had lots of issues with this the other day but after a couple of cache clears it suddenly started working.

like image 20
Bill Avatar answered Nov 07 '22 14:11

Bill