样式表已链接但未加载?

时间:2014-02-26 15:34:00

标签: css ruby-on-rails twitter-bootstrap

从rails 3.2到4重建应用程序,除了我的一些样式表没有被应用之外,一切都很顺利。当我ctru-U他们似乎联系好了:

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Badge2</title>
    <meta name="description" content="Badge2">
    <link data-turbolinks-track="false" href="/assets/application.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="false" href="/assets/badges.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="false" href="/assets/framework_and_overrides.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="false" href="/assets/home.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="false" href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
    <script data-turbolinks-track="true" src="/assets/jquery.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/jquery_ujs.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/turbolinks.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/bootstrap-transition.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/bootstrap-affix.js?body=1"></script>
...
<script data-turbolinks-track="true" src="/assets/badges.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/home.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/application.js?body=1"></script>
    <meta content="authenticity_token" name="csrf-param" />
<meta content="0kPf5I9Ayz6yEM/RLbfyYmzTdixuoyf5Z4w9iPyuGaU=" name="csrf-token" />
  </head>
  <body>
    <header>

但是当我点击/assets/badges.css?body=1时,它是空白的。 (当然它的样式不适用。)脚手架和框架负载,但家和徽章没有。 (或加载空白/空)。我错过了什么?

1 个答案:

答案 0 :(得分:0)

答案似乎是这一行:

<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>

需要尾随/.

我从旧的rails 3.2应用程序中复制了它,它在哪里工作。

奇怪的是,badges.css文件中已经有了css注释,总线sass删除了单行注释(// ...)并保留了多行注释(/ * ... * /)。