【发布时间】:2011-11-07 15:17:45
【问题描述】:
有时在繁重的客户端 Javascript 中,我们将标签放在 HTML 文件的末尾,以便先显示内容,然后再加载 Javascript。
是否可以使用 Rails 3.1 资产管道做到这一点?
编辑:
<html>
<head>
<%= javascript_include_tag "application" %>
</head>
<body>
<!-- all the page content goes here -->
<!-- we include these at the bottom to ensure the html loads first and the javascript is loaded afterwards. How can we achieve this through rails asset pipelining? -->
<script src="/some_other_assets/first_file.js"></script>
<script src="/some_other_assets/second_file.js"></script>
<script src="/some_other_assets/third_file.js"></script>
</body>
</html>
【问题讨论】:
标签: javascript performance ruby-on-rails-3.1 asset-pipeline