Khanh Pham
Khanh Pham

Reputation: 2973

Error favicon.ico same as query in show page rails 4.2.0

This is my log:

Started GET "/videos/favicon.ico" for 42.112.87.124 at 2015-07-12 19:26:54 +0700
Processing by VideosController#show as 
Parameters: {"id"=>"favicon"}
Video Load (0.2ms)  SELECT  `videos`.* FROM `videos` WHERE `videos`.`id` = 0 LIMIT 1
Completed 500 Internal Server Error in 3ms

And this is code in my application.html.erb

<%= favicon_link_tag 'favicon.ico' %>
<%= stylesheet_link_tag  'application', media: 'all'%>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

And this is my routes.rb:

resources :videos, only: [:index, :show]

Upvotes: 1

Views: 279

Answers (1)

spickermann
spickermann

Reputation: 106922

Change

<%= favicon_link_tag 'favicon.ico' %>

to

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

to load the favicon from the server's root instead of the folder relative to the document.

Upvotes: 1

Related Questions