Hommer Smith
Hommer Smith

Reputation: 27852

Favicon routing error

I have added this to my application layout:

 <%= favicon_link_tag 'favicon.png' %>

Because I have my favicon icon under /assets/images.

However, I keep getting this error on my logs:

ActionController::RoutingError (No route matches [GET] "/favicon.ico")

It just stops if I add an empty favicon.ico under /public. But I don't get it, because I am not saying anywhere in my project to look for a favicon.ico

Any thoughts?

Upvotes: 0

Views: 1344

Answers (1)

Sachin R
Sachin R

Reputation: 11876

try this

<%= favicon_link_tag '/favicon.png', :type => ‘image/png’ %>

It will create link like

<link href="/assets/favicon.png" rel="shortcut icon"  :type => ‘image/png’ />

Upvotes: 1

Related Questions