Reputation: 19969
In localhost / WEBrick configuration (Rails 3.1, ruby 1.9.2, one of my routes takes the favicon.ico file as a request parameter. It seems to be only on this one route and am not sure sure why it is doing this:
In my routes: routes.rb
scope '/arc' do
match '/item/:id' => 'items#show', :as => :item_show # id can be either integer or text
end
In html:
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
Started GET "/arc/item/test-306-some-item" for 127.0.0.1 at 2012-10-18 12:18:18 -0700
... why is it doing this??? only on the above route?
Started GET "/arc/item/favicon.ico" for 127.0.0.1 at 2012-10-18 12:18:22 -0700
Creating scope :page. Overwriting existing method Item.page.
Processing by ItemsController#show as
Parameters: {"id"=>"favicon"}
Any ideas on why it would be doing this?
Upvotes: 2
Views: 1384
Reputation: 2515
Try:
<link rel="icon" type="image/png" href="<%= image_path("favicon.png") %>" />
Upvotes: 0
Reputation: 6728
You need to give the full path of the favicon
Like
<link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon" />
In order to work in all environment like development and production you can use Rails tag for this
<%= favicon_link_tag "favicon.ico" %>
Upvotes: 0