开发者

How to prevent sprocket code clashes Rails 3.1

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜