简体   繁体   English

jQuery和Rails 3资产管道

[英]jquery and rails 3 asset pipeline

Just a quick question as I am trying to clarify my understanding of the asset pipeline. 在尝试澄清对资产管道的理解时,这只是一个简短的问题。

So if i have 所以如果我有

   //= require jquery_ujs

in my application.js file, does this mean that rails will call the neccesary library for me or do i still need to put the actual libary in my assets/javascripts directory. 在我的application.js文件中,这是否意味着Rails会为我调用必要的库,还是我仍然需要将实际的库放在我的asset / javascripts目录中。

I have read some documentation but the theory behind it all isnt quite there 我已经阅读了一些文档,但是所有这些背后的理论还不存在

Any help/advice appreciated 任何帮助/建议表示赞赏

I have found out the answer for this: When you add // require jquery_ui rails is actually dynamically calling the js file for this. 我已经找到了答案:当添加// require jquery_ui时,rails实际上是为此动态调用js文件的。 so for example if I had jquery-ui-1.8.19.custom.min.js in my assets/javascripts directory I could remove this as I am already calling it in my application.js file via the asset pipelin 因此,例如,如果我在asset / javascripts目录中有jquery-ui-1.8.19.custom.min.js,我可以删除它,因为我已经通过资产pipelin在application.js文件中调用了它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM