我有
<%= javascript_include_tag "application" %>
我以为我应该
<script src="/assets/application.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/home.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
答案 0 :(得分:1)
很可能是因为您处于开发模式。在开发模式下,config.assets.debug
默认为true
,阻止Sprockets连接您的javascript / css包含。在config/evironments/development.rb
设置
config.assets.debug = false
在this Rails Guide中了解它。