Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6527 (closed enhancement: untested)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Add onException() callback handling to PrototypeHelper

Reported by: emezeske Assigned to: David
Priority: normal Milestone: 1.x
Component: ActionPack Version: edge
Severity: normal Keywords: ajax prototypehelper
Cc:

Description

When calling PrototypeHelper::remote_function(), the options hash may contain keys :success and :failure, which allow the caller to specify, respectively, onSuccess() and onFailure() JavaScript callbacks for the Ajax.updater() object. My patch adds the symbol :exception to this list so that the caller may specify an onException() JavaScript callback. This is necessary so that if the Ajax transport throws an exception it may be handled gracefully.


This is an extremely well defined, not-even-one-line addition, so I haven't included a test case. Without this patch, it is not possible to respond to exception-based Ajax errors (such as the server going down).

Attachments

prototype_helper_fix.diff (0.8 kB) - added by emezeske on 11/01/06 01:42:20.
Patch

Change History

11/01/06 01:42:20 changed by emezeske

  • attachment prototype_helper_fix.diff added.

Patch

11/01/06 01:43:30 changed by emezeske

  • keywords changed from Ajax, PrototypeHelper to Tiny, Ajax, PrototypeHelper.

03/13/07 22:24:54 changed by josh

  • keywords changed from Tiny, Ajax, PrototypeHelper to tiny ajax prototypehelper.

06/25/07 18:36:44 changed by josh

  • keywords changed from tiny ajax prototypehelper to ajax prototypehelper.
  • status changed from new to closed.
  • resolution set to untested.

Can you please attach a test case covering the new behavior.