Chapter 16. Creating Dynamic Interfaces with Rails and Ajax

Rails emerged at about the same time as Ajax did, and the two technologies can work tightly together. Ajax, a set of technologies for creating much more interactive interfaces in the browser, can connect neatly to Rails’ more server-based approach. There’s much more than that, though, as the Rails framework includes a number of components designed specifically for making it easier to build Ajax applications from inside of Rails.

Note

As we mentioned back in Chapter 5, you can download plug-ins, such as ActiveScaffold (http://activescaffold.com), that provide a lot of built-in Ajax functionality to get you started exploring.

Ajax Basics

If you need to read this section, it’s probably a sign that you should find a book devoted to Ajax before building Ajax applications on top of Rails. Rails provides an excellent set of technologies for supporting Ajax development, but you still need to know how to work with the JavaScript browser side of Ajax before you can make effective use of them.

Note

Ajax development is itself worth a book or even a shelf of books, depending on how you want to go about it. Even Rails-based Ajax development has a book: Scott Raymond’s Ajax on Rails (O’Reilly, 2007). This chapter will get you started, but there’s an almost infinite amount of potential complexity around this subject.

Most of what Ajax does today is what used to be called Dynamic HTML, or DHTML. DHTML built on regular HTML by adding ...

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.