Chapter 11. Reference

The library by Thomas Fuchs (with numerous contributions from the community) is distributed in six files: scriptaculous.js, builder.js, effects.js, dragdrop.js, controls.js, and slider.js.[*] Including scriptaculous.js will automatically include the other five files, if they are in the same directory. Prototype (which depends on) must be included separately.

[*] This chapter covers version 1.6.1.

<script src="/books/4/386/1/html/2//js/prototype.js" type="text/javascript"></script> <script src="/books/4/386/1/html/2//js/scriptaculous.js" type="text/javascript"></script>

The standard Rails skeleton (as generated by rails myapp) includes effects.js, dragdrop.js, and controls.js in the public/javascripts directory.

From within a Rails view or layout file, the javascript_include_tag helper can be used to include external JavaScript files. By passing it :defaults, it will include Prototype, the Rails-standard files, and application.js, if present:

<%= javascript_include_tag :defaults %>

Demos, downloads, and announcements are available from the official web site ( Documentation and example code are available from the official wiki (

The library (and this chapter) has seven major parts: visual effects, drag and drop, controls, element extensions, DOM builder, JavaScript unit testing, and miscellaneous utility methods.

Ajax on Rails
Ajax on Rails
ISBN: 0596527446
EAN: 2147483647
Year: 2006
Pages: 103
Authors: Scott Raymond

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: