2

Rails 3.1.10 Active_scaffold 3.2.17

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.

4

2 に答える 2

3

何が悪いのかを見つけるのに半日を費やしました。

jQuery("form.as_form").live' は関数ではありません。これは、gemfile にあるためです。

宝石「active_scaffold」

Jquery 1.9の廃止された.liveを別のjsライブラリで呼び出す3.2.17バージョンをインストールしています)。代わりに、.on call が必要です。しかし、active_scaffold のリリースされたバージョン 3.2.17 には.live ((

最後に私の解決策は

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

3.3.0.rc が含まれており、.live の代わりに .on jquery 呼び出しが含まれています。

于 2013-01-22T15:11:47.937 に答える
1

active_scaffold の github のマスター ブランチは Rails 3.1 のサポートを終了したため、Gemfile を更新して jquery-rails gem を JQuery 1.8.3 を使用するものに修正することで解決できます。

gem 'jquery-rails', '2.1.4'
于 2013-02-08T23:27:16.363 に答える