O'Reilly logo

Ruby on Rails® Bible by Timothy Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required