Rails 3.1,jQuery UI无法加载 [英] Rails 3.1, jQuery UI does not load

查看:83
本文介绍了Rails 3.1,jQuery UI无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Rails 3.1并在jQueryUI库中遇到问题.这是我的application.js文件:

I am using Rails 3.1 and having an issue with the jQueryUI library. Here is my application.js file:

//= require jquery
//= require jquery-ui
//= require jquery_ujs
// Loads all Bootstrap javascripts
//= require bootstrap
//= require rails.validations

//= require_tree .

它将"jquery ui"文件加载到浏览器中,但是与之相关的任何使用都会显示此错误:

It loads the "jquery ui" file into the browser, but whatever I use related to it it shows this error:

TypeError: Object function (a,b){return new d.fn.init(a,b,g)} has no method 'dialog'

推荐答案

经过数小时的努力,我终于从application.js中删除了//= require jquery-ui并添加了新的jQuery UI文件,现在一切正常.我的新资产文件是:

After hours of struggling with the issue, I finally removed //= require jquery-ui from application.js and added the new jQuery UI file, and everything works fine now. My new asset file is:

//= require jquery
//= require jquery/jquery-ui
//= require jquery_ujs
// Loads all Bootstrap javascripts
//= require bootstrap
//= require rails.validations

//= require_tree .

jquery是我的javascripts文件夹中的子文件夹.

jquery is a sub-folder in my javascripts folder.

这篇关于Rails 3.1,jQuery UI无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆