Search code examples
ruby-on-rails-3activescaffold

Rails 3.1 active_scaffold 'jQuery("form.as_form").live' is not a function


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.


Solution

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

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

    gem 'active_scaffold'

    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 ((

    At last My solution is

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

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