图标未显示在 rails 网站中 [英] Icon not displayed in rails website

查看:45
本文介绍了图标未显示在 rails 网站中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Rails 的新手.

I am a newbie in rails.

我在我的公共文件夹中放了一个新的 favicon.ico 并删除了旧的.

I had put a new favicon.ico in my public folder and deleted the old one.

我还编写了一个代码,其中我必须将新图标用于例如:-

I have also written a code wherein I have to use the new icon for eg:-

  <link rel="icon" type="image/x-icon" href="favicon.ico" />
  <%= favicon_link_tag 'favicon.ico' %>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">

  <%  user_agent = request.env['HTTP_USER_AGENT'] %>
  <%  if /Windows/.match(user_agent).nil? %>
      <%= stylesheet_link_tag    "application", :media => "all" %>
      <%= stylesheet_link_tag    "application2", :media => "all" %>
  <%  else %>
      <% if user_agent.include? "Safari" and !user_agent.include? "Chrome" %>
          <%= stylesheet_link_tag    "safariwindows", :media => "all" %>
          <%= stylesheet_link_tag    "safariwindows2", :media => "all" %>
      <% else %>
          <%= stylesheet_link_tag    "windowsapplication", :media => "all" %>
          <%= stylesheet_link_tag    "windowsapplication2", :media => "all" %>
      <% end %>
  <% end %>

  <%= javascript_include_tag "application" %>

  <!--[if gte IE 7]>
      <%= stylesheet_link_tag    "ie", :media => "all" %>
    <![endif]-->
  <%= stylesheet_link_tag '/video-js/video-js.min' %>
  <%= javascript_include_tag '/video-js/video.min' %>
  <%= javascript_include_tag 'http://j.maxmind.com/app/geoip.js' %>
  <%= csrf_meta_tags %>
  <script>
      pki = "<%= session[:pki] %>"
  </script>

我也清除了缓存并尝试了隐身模式,但仍然无法正常工作.

I have also cleared cache and also tried in incognito mode but still not working.

谁能给出任何解决方案.

Can anyone give any solutions.

推荐答案

试试这个 -

<link rel="shortcut icon" href="favicon.ico" />

这篇关于图标未显示在 rails 网站中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆