2012-08-09 83 views
0

第一Rails應用程序 - 渲染

<%= 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> 

回答

1

很有可能是因爲你在開發模式是。在開發模式config.assets.debug默認爲true,防止鏈接你的JavaScript/CSS包括。在config/evironments/development.rbthis Rails Guide設置

config.assets.debug = false 

讀到它。