I upgrade the application from Rails 2 to 3 and recycle all removed functions to use Unobtrusive Javascript. Where I'm afraid this is handling ajax callbacks in UJS.
There are many resources that I found that show how to implement these callbacks using jQuery, but not much for the prototype. Perhaps you can help me figure this out.
In Rails 2, I had the following:
<% remote_form_for @foo, {:loading => "loading_function()", :complete => "complete_function()" } do |f| %>
...
<% end %>
In Rails 3, I have the following:
<%= form_for @foo, :remote => true do |f| %>
....
<% end %>
From what I have guessed so far (which might be wrong), I need to attach my old upload / exit functions to the form so that they are fired by the handleRemote function in Rails.js. I just don't know how to do this.
Again, I am doing this in Prototype. Therefore, responses related to this structure are evaluated.