wood burning stoves
The moose likes Ruby and the fly likes Ajax functionality with Rails? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Ajax functionality with Rails?" Watch "Ajax functionality with Rails?" New topic

Ajax functionality with Rails?

Tina Ma
Ranch Hand

Joined: Nov 29, 2007
Posts: 198
Does REST web-services allow any AJAX functionality for Rails applications?

SCJP 1.4, SCWCD 1.4
Tina Ma
Ranch Hand

Joined: Nov 29, 2007
Posts: 198
I ask as I was wondering REST can post and invoke XML requests and supports HTTP protocol and this is a web-service API...so its highly probable it can give AJAX like functionality to a RAILS application. If this is true, my question is HOW?
Ben Scofield

Joined: May 20, 2008
Posts: 29
AJAX is entirely independent of REST; a RESTful application can be made to use AJAX or not, as your needs indicate. Rails 2 has added some features that make adding this sort of dynamic behavior to your application even easier than it has been in the past, however. Chapter 2 of my book deals with this in part, and you see hints of it in some of the projects that follow.

Essentially, the idea is that an AJAX request is just a standard HTTP request with a specific format. Rails allows you to respond differently to different request formats automatically, which means that you can layer a RESTful web service on top of a standard, HTML-based web application very easily.
I agree. Here's the link: http://aspose.com/file-tools
subject: Ajax functionality with Rails?
It's not a secret anymore!