small medium large xlarge

30 Jun 2010, 23:07
Douglas Marker (1 post)

One of the reasons I bought the book (having bought the prior versions) was to try to work my way thru the problems I have with my earlier apps that use observe_form.

I know the designers decoupled RoR from the prototype.js but trying to find anyone on the net who can explain how the new way to do an observe_form call is proving utterly fruitless and painful.

The only way I got it working in the end was to use a plug-in that restored the methods that link directly to prototype.js

I am trying to understand what I need to do to follow the new rails.js protocol but after 4 weeks of looking am still mystified.

I was hoping this book would cover these dramatic changes in RoR 3.0 but can’t find any reference to observe_form.

I am wondering if I now need to become expert in js and by pass the RoR interface to them ?


Doug Marker - IT Architect (using RoR for prototyping apps)

30 Jun 2010, 23:46
Sam Ruby (633 posts)

I haven’t gotten to those chapters yet, but will confirm that my understanding matches yours.

Rails has deprecated observe_form, and the function is no longer considered part of core Rails. Instead, you can get that function through the prototype legacy helper plugin.

Alternatively, you may use the JavaScript framework of your choice directly to perform to attach events to elements. Rails 3.0 does not abstract away the differences between the various JavaScript frameworks for this function.

Implementing this function without making use of the plugin will require an understanding of the JavaScript framework. Examples are available online. A detailed description of the various JS frameworks is unfortunately beyond the scope of this book.

You must be logged in to comment