• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Ajax functionality with Rails?

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does REST web-services allow any AJAX functionality for Rails applications?
 
Tina Ma
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
author
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic