Rails 3.1 is all nice and good, except with a fairly decent sized application I am getting lots of code clashes because rails is now throwing all my scripts together and serving them to every page. There must be a way to prevent page-specific code from being bundled up and served al开发者_运维知识库l the time?
The culprit is require_tree .
in app/assets/javascripts/application.js
:
http://edgeguides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives
Replace that line with one or more individual require statements.
精彩评论