Rails 3.1 active_scaffold 'jQuery("form.as_form").live' 不是函数 [英] Rails 3.1 active_scaffold 'jQuery("form.as_form").live' is not a function

查看:58
本文介绍了Rails 3.1 active_scaffold 'jQuery("form.as_form").live' 不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rails 3.1.10Active_scaffold 3.2.17

Rails 3.1.10 Active_scaffold 3.2.17

我收到了 js 错误消息:

I got the js error message:

Event thread: DOMContentLoaded
Uncaught exception: TypeError: 'jQuery("form.as_form").live' is not a function
Error thrown at line 25, column 5503 in <anonymous function>() in http://localhost/assets/application.js?body=1:
jQuery("form.as_form").live("ajax:beforeSend",function(e){var t=jQuery(this).closest("form");return....................................

有人可以帮忙吗?谢谢.

Could anyaone help? Thanks.

推荐答案

我花了半天时间才找出问题所在.

I spent half a day to find out what is wrong.

jQuery("form.as_form").live' 不是函数 这是因为我的 gemfile 中有:

jQuery("form.as_form").live' is not a function it is because of I have in my gemfile:

宝石 'active_scaffold'

gem 'active_scaffold'

它正在安装一个 3.2.17 版本,其中包含不同 js 库中的 Jquery 1.9 调用 .live 的过时版本).相反,必须有 .on call.但发布的 active_scaffold 3.2.17 版本包含 .live ((

It's installing a 3.2.17 version that contains obsolete for Jquery 1.9 calls .live in different js libraries). Instead there have to be .on call. But released version 3.2.17 of active_scaffold contains .live ((

最后我的解决方案是

gem 'active_scaffold', git: "https://github.com/activescaffold/active_scaffold.git"

它包含 3.3.0.rc 并且它包含 .on jquery 调用而不是 .live.

it contains 3.3.0.rc and it contains .on jquery calls instead .live.

这篇关于Rails 3.1 active_scaffold 'jQuery("form.as_form").live' 不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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