rails资产管道application.css加载本身搞乱css

时间:2013-04-30 02:39:52

标签: ruby-on-rails asset-pipeline

直到现在,我一直在我的本地环境中加载我的css文件而没有像这样的预编译:

= stylesheet_link_tag    "bootstrap.min", :media => "all"
= stylesheet_link_tag    "bootstrap-responsive.min", :media => "all"
= stylesheet_link_tag    "font-awesome.min", :media => "all"
= stylesheet_link_tag    "ace.min", :media => "all"
= stylesheet_link_tag    "ace-responsive.min", :media => "all"
= stylesheet_link_tag    "ace-skins.min", :media => "all"
= stylesheet_link_tag    "datepicker", :media => "all"

但我现在要将其更改为预编译...所以我在application.css中执行了此操作:

/*
 *= require bootstrap.min
 *= require bootstrap-responsive.min
 *= require font-awesome.min
 *= require ace.min
 *= require ace-responsive.min
 *= require ace-skins.min
 *= require datepicker
 */

然而,它在html:

中加载css文件
<link href="/assets/bootstrap.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap-responsive.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/font-awesome.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/ace.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/ace-responsive.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/ace-skins.min.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/datepicker.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />

最后一行加载application.css搞砸了CSS,我不知道如何摆脱它。没有它,它看起来很完美。我没有明确加载它..只是用它来加载资产。如何阻止最后一行加载?它会自动出现而不在application.css中调用它

2 个答案:

答案 0 :(得分:0)

通常在您的application.html.erb(app / views / layouts)中将包含文件。检查那里的要求。

答案 1 :(得分:0)

结果我需要:* = require_self在application.css中,一切正常工作