Question

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.

Was it helpful?

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.

OTHER TIPS

Master branch on github of active_scaffold has dropped Rails 3.1 support, so the solution for that is to update your Gemfile to fix the jquery-rails gem to to one that uses JQuery 1.8.3:

gem 'jquery-rails', '2.1.4'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top