Chapter 10. Using Prototype and script.aculo.us

Today's browser-based applications are becoming more dynamic, more interactive, and richer than they have ever been before. Alternative Web application solutions such as Flash have increased user expectations of what is possible in a Web application. If HTML applications are to remain a viable solution for developing rich Internet applications, then web developers need to use all the power of JavaScript in ways it has never been used before.

This chapter will introduce you to the JavaScript libraries Prototype and script.aculo.us, and you'll see how you can use those libraries to develop highly interactive and rich Web 2.0-style applications built on the Rails framework. Just as using Rails can increase your productivity when developing server-side code for your Web applications, using Prototype and script. aculo.us will increase your productivity in writing client-side JavaScript.

Rails provides a number of useful helpers for integrating these libraries using Ruby code, however at some point you will reach the limits of what is possible using RJS, and it'll be time for you to work directly in JavaScript. Knowing the details of these libraries will help you make your application unique.

Prototype, script.aculo.us, and Rails

The Prototype and script.aculo.us JavaScript libraries are included with the Rails distribution. When you install Rails, you also get these libraries with nothing more to install. Rails support for these libraries doesn't ...

Get Ruby on Rails® Bible 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.