我想了解网络应用程序。我决定边做边学,并选择从 Camping 作为 (i) 开始。它很小&(ii)。我知道一些红宝石。
图标未显示。我正在使用从另一个站点获取的图标,因此它知道其文件格式是有效的。
这是来自控制器的代码。
class Favicon < R '/favicon\.ico'
# Load the favicon into memory
FAVICON = File.read('favicon.ico')
def get
@headers['Content-Type'] = "image/x-icon"
FAVICON
end
end
这是视图中的代码:我故意放置了两次指向图标的链接作为实验。没有喜悦。
def layout
html do
head do
title 'Custom Made Kameez'
link :rel => 'icon', :href => 'favicon.ico', :type => 'image/x-icon'
link :rel => 'shortcut icon', :href => 'favicon.ico', :type => 'image/x-icon'
link :rel => 'stylesheet', :type => 'text/css', :href => '/styles.css', :media => 'screen'
end
我尝试清除缓存并使用 Firefox 和 IE,同样的问题。