ScriptaculousHelper

Like the PrototypeHelper methods, ScriptaculousHelper methods provide ready Ruby-based access to JavaScript components in the browser. While Prototype focuses on basic Ajax communications, Script.aculo.us focuses more on actions and special effects:

draggable_element

Identifies an HTML element, specified by id attribute value, as supporting user efforts to drag it around the screen and potentially drop it on a receiving element.

drop_receiving_element

Identifies an HTML element, again by id attribute value, as a container where users can drop draggable objects and expect a response. When the drop happens, the code this creates can make a remote Ajax call or a local JavaScript call, and supports class-based constraints on which objects to accept. It also supports changing the class of the receiving element to give users visual feedback when they’ve positioned a draggable object over a container that could accept it.

sortable_element

Identifies an HTML element, again by id attribute value, as a collection users can reorder, making an Ajax call when changes occur.

visual_effect

Provides access to the Script.aculo.us library’s collection of visual effects, applying them to an HTML element specified by id.

Get Learning Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.