简体   繁体   English

jQuery lib包含与rails3和twitter-bootstrap-rails的冲突

[英]jQuery lib include conflict with rails3 and twitter-bootstrap-rails

I've an app with rails3 using jQuery by default and twitter-bootstrap-rails and got a problem. 我有一个默认情况下使用jQuery和twitter-bootstrap-rails的带有rails3的应用程序,出现了问题。

jQuery seems to be included twice, causing links using :remote => true to be called twice too.. jQuery似乎被包含两次,导致使用:remote => true链接也被调用两次。

If i put the return of javscript_include_tag :application in my app directly and do some tests i got the following: 如果我直接将javscript_include_tag :application的返回值放在我的应用程序中并进行一些测试, javscript_include_tag :application得到以下结果:

  • jquery.js with no application.js => remote links works perfectly 没有application.js =>远程链接的jquery.js可以正常工作
  • jquery.js with application.js => remote links called twice 带有application.js的jquery.js =>两次调用了远程链接
  • no jquery.js but application.js at the top => remote links called twice too 没有jquery.js,但在顶部的application.js =>远程链接也被调用了两次

My application.js just contain: 我的application.js仅包含:

//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .

Any ideas how to resolve this problem cleanly ? 有什么想法可以彻底解决这个问题吗?

Just found this post that solves the issue. 刚刚找到解决问题的帖子 Its a bug with the asset pipeline and was filed here . 这是资产管道的错误,已在此处提交。

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

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