Book Image

Building Dynamic Web 2.0 Websites with Ruby on Rails

By : A P Rajshekhar
Book Image

Building Dynamic Web 2.0 Websites with Ruby on Rails

By: A P Rajshekhar

Overview of this book

<p>Ruby on Rails is an open-source web application framework ideally suited to building business applications; accelerating and simplifying the creation of database-driven websites. Often shortened to Rails or RoR, it provides a stack of tools to rapidly build web applications based on the Model-View-Controller design pattern.<br />&nbsp;<br />This book is a tutorial for creating a complete website with Ruby on Rails. It will teach you to develop database-backed web applications according to the Model-View-Controller pattern. It will take you on a joy ride right from installation to a complete dynamic website. All the applications discussed in this book will help you add exciting features to your website. This book will show you how to assemble RoR's features and leverage its power to design, develop, and deploy a fully featured website. Each chapter adds a new feature to the site, adding new knowledge, skills, and techniques.</p>
Table of Contents (16 chapters)
Building Dynamic Web 2.0 Websites with Ruby on Rails
Credits
About the Author
About the Reviewer
Preface
Index

Implementing Ajax


We have defined the functionalities that we are going to Ajaxify. However, before we implement Ajax, we need to understand two points:

  • What is Ajax

  • How RoR and Ajax are related

Let us have a look at these points.

What is Ajax?

Ajax is not a single technology. It is, essentially, a combination of technologies. The term Ajax can be expanded to Asynchronous JavaScript and XML. The keyword here is Asynchronous. Typically, a web page will stop all its work until it receives a response from the server. For such a web page, the communication (sending a request to the server and getting a response from the server) is synchronous. However, if a web page sends the requests and does not wait for the reply to resume processing, then it uses the asynchronous method of communication. Ajax helps developers to implement the asynchronous method of communication using JavaScript.

The XMLHTTPRequest object of JavaScript can be used to send a request to the server and then do the required changes...