开发者

How to prevent sprocket code clashes Rails 3.1

开发者 https://www.devze.com 2023-03-18 04:53 出处:网络
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. Th

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

精彩评论

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