Favicon出现在本地的rails上,而不是在托管应用程序上 [英] Favicon shows up on rails local, not on hosted app
问题描述
我把我的favicon.ico放在我的公共文件夹中,它显示在我的本地主机上,但是当我在互联网上查看时,代替。我的应用程序通过heroku托管,并通过悬停提供域。这个失败在哪里?
另外,如果这有帮助,下面是我用来呈现图标的代码:
<!DOCTYPE html>
< html>
< head>
< link rel =快捷图标href =/ favicon.ico/>
< title> Shoulak Predictions< / title>
<%= stylesheet_link_tag'application',media:'all'%>
<%= javascript_include_tag'application'%>
<%= csrf_meta_tags%>
<%= render'layouts / shim'%>
< / head>
< body>
<%=呈现'layouts / header'%>
< div class =container>
<%flash.each do | key,value | %GT;
< div class =alert alert-<%= key%>><%= value%>< / div>
<%end%>
<%= yield%>
< / div>
< div class =container>
<%=渲染'layouts / footer'%>
<%= debug(params)如果Rails.env.development? %GT;
< / div>
< / body>
< / html>
更新
如果我转到 mydomain.com/favicon.ico
,我会下载我上传的图标。此外,如果我去 therealapp.herokuapps.com
,它就会显示出来。我想我的域名提供商可能会提供他们自己的?
我在做Hover转发,而不是使用DNS功能。悬停自动使用他们自己的图标。
I put my favicon.ico in my public folder, and it shows up on my localhost, but when I check it out on the internet, shows up instead. My app is hosted through heroku, and the domain is provided by hover. Where is this failing?
Also, in case this helps, here is the code I'm using to render the favicon:
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/favicon.ico" />
<title>Shoulak Predictions</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container">
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>"><%= value %></div>
<% end %>
<%= yield %>
</div>
<div class="container">
<%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
</div>
</body>
</html>
Update
If I go to mydomain.com/favicon.ico
, I do download the favicon that I uploaded. ALSO, if I go to therealapp.herokuapps.com
, it shows up. I think somehow my domain provider may be providing their own?
I was doing Hover forwarding, not using the DNS features. Hover automatically uses their own favicon.
这篇关于Favicon出现在本地的rails上,而不是在托管应用程序上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!