0

我的布局视图中有这个

<%= stylesheet_link_tag    "application", :media => "all" %>
<%= javascript_include_tag "jquery-1.10.1.min" %>
<%= javascript_include_tag "bootstrap.min" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>

为什么页面呈现时我会得到所有这些?

<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery-1.10.1.min.js" type="text/javascript"></script>
<script src="/assets/bootstrap.min.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/LZA.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/MapKit.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/Torch.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/cordova-2.6.0.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/jquery-1.10.1.min.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/jquery-1.9.1.min.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/jquery.form.js?body=1" type="text/javascript"></script>
<script src="/assets/LZA/jquery.mobile-1.3.1.min.js?body=1" type="text/javascript"></script>
<script src="/assets/apps.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap.min.js?body=1" type="text/javascript"></script>
<script src="/assets/home.js?body=1" type="text/javascript"></script>
<script src="/assets/simulator.js?body=1" type="text/javascript"></script>
<script src="/assets/webservice.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>

我所做的只是将一些.css.js文件添加到文件夹中,以便我可以在站点的其他地方使用它们...

4

1 回答 1

1

查看您的application.js文件(或包含的任何其他文件),您应该会看到类似

//= require home
//= require simulator
//= require webservice

这就是提取名为和的文件home.js,并将它们添加到您的站点。simulator.jswebservice.js

查看Rails 资产管道

于 2013-06-29T03:44:52.727 回答