ActionController::RoutingError (No route matches [GET] “/favicon.ico”) in Rails

后端 未结 4 786
我在风中等你
我在风中等你 2021-01-31 03:09

I have tried to use

 

as well as this



        
4条回答
  •  爱一瞬间的悲伤
    2021-01-31 03:46

    This is what Rails generates in application.html.erb by default:

    <%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
    

    It doesn't find favicon.ico this way when it's under /public

    It works correctly (finds favicon.ico under /public) if you change the tag to:

    <%= favicon_link_tag %>
    

提交回复
热议问题