Bjoernsen
Bjoernsen

Reputation: 2418

Favicon not found in production mode

Firefox does not find the favicon of my Rails 3.1 app in production mode. Running in development mode, it works.

I browse to the URL localhost:4000/favicon_standing.ico for both modes. The favicon is located in my public folder of my app. I do not use the asset pipeline for it. I start the server using rails s -p 4000 -e production and rails s -p 4000, respectively, using WEBrick.

Why does is for in development mode, but not in production mode?

Upvotes: 3

Views: 2183

Answers (2)

okliv
okliv

Reputation: 3959

there is a helper for this

<head>
...
<%= favicon_link_tag %>
<!-- you can skip the name of file if it is favicon.ico  -->
...
</head>

all you need is to place your favicon to assets/images/ folder and recompile assets

Upvotes: 1

James
James

Reputation: 69

I'd try changing the name of your file to 'favicon.ico' and see if that helps. While its not required, its the default naming convention and if you're using another name, you have to add some html to your head:

<link rel="shortcut icon" href="http://www.my-domain.com/myfavicon.ico" type="image/x-icon" />

Here's what some googling shows: http://www.make-a-favicon.com/favicon_FAQs.htm#Are_all_favicon_files_named_favicon.ico

Upvotes: 2

Related Questions