字体真棒和图像不加载在ruby-on-rails-4生产firefox [英] font-awesome and images is not loaded in ruby-on-rails-4 production firefox
问题描述
我在ruby-on-rails-4中使用font-awesome,而在我的开发模式下,chrome和firefox都可以正常工作
。但我无法找出什么原因,字体真棒和图像没有加载到生产模式,其中font-awesome在铬合金工作正常。
试试这在字体真棒在轨4:
https://coderwall.com/p/1uqvkq
希望这会有帮助。
或
如果上面的一个不适合你,请试试这个。
优先:向资产路径(config / application.rb)添加 app / assets / fonts
config.assets.paths<< Rails.root.join(app,assets,fonts)
然后移动字体文件放入/ assets / fonts(首先创建文件夹) 让我们试试这个。 I am using font-awesome in ruby-on-rails-4 and in my development mode everything works fine
in both chrome and firefox. But i am not able to find out what is the reason that font-awesome and images is not loaded into production mode, where font-awesome is works fine in chrome. Try this for font-awesome in rails 4: https://coderwall.com/p/1uqvkq Hope it will help. Or
Try this if above one not working for you.
first: add then move the font files into /assets/fonts (create the folder first) Now rename the font-awesome.css to font-awesome.css.scss.erb and edit it like this: change: to this: Lets try this. 这篇关于字体真棒和图像不加载在ruby-on-rails-4生产firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
现在将font-awesome.css重命名为font-awesome.css.scss.erb并将其编辑为这个:改变:
pre $ @ font-face {
font-family:FontAwesome;
src:url('../ font / fontawesome-webfont.eot'); (''/ font / fontawesome-webfont.eot?#iefix')格式('eot'),url('../ font / fontawesome-webfont.woff')格式('woff (''/ font / fontawesome-webfont.svg#FontAwesome')格式('svg');
font-weight:normal;
font-style:normal;
$ b $ p
@ font-face {
font-family:FontAwesome;
src:url('<%= asset_path(fontawesome-webfont.eot)%>'); $('eot'),url('<%= asset_path('格式('woff'),url('<%= asset_path(fontawesome-webfont.ttf)%>')格式('truetype'),url ('<%= asset_path(fontawesome-webfont.svg)+#FontAwesome%>')format('svg');
font-weight:normal;
font-style:normal;
code
app/assets/fonts
to the asset path (config/application.rb)config.assets.paths << Rails.root.join("app", "assets", "fonts")
@font-face {
font-family: "FontAwesome";
src: url('../font/fontawesome-webfont.eot');
src: url('../font/fontawesome-webfont.eot?#iefix') format('eot'), url('../font/fontawesome-webfont.woff') format('woff'), url('../font/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "FontAwesome";
src: url('<%= asset_path("fontawesome-webfont.eot") %>');
src: url('<%= asset_path("fontawesome-webfont.eot") + "?#iefix" %>') format('eot'), url('<%= asset_path("fontawesome-webfont.woff") %>') format('woff'), url('<%= asset_path("fontawesome-webfont.ttf") %>') format('truetype'), url('<%= asset_path("fontawesome-webfont.svg") + "#FontAwesome" %>') format('svg');
font-weight: normal;
font-style: normal;
}