mattmccray

 
« Nothing New Under the… | Home | So What Have I Been W… »

AJAX and Rails

» Published March 10, 2005 under Rails, Software

rails_logo_remix_small.gif I posted previously about communicating with Rails using XMLHttpRequest, or AJAX, as it’s starting to be called. Since that post, Rail 0.10 (and 0.10.1!) were released with the new Routes functionality.

Anyway, I’ve created a couple of JavaScript classes to aid in using the XMLHttpRequest stuff. I’ve been using them on a little project I’ve been working on (and will soon announce) and they are working great on Safari, Firefox, and Windows IE 6! I updated them for use with Routing and, being the nice guy that I am, I thought I’d share them with the world.

I call them Connectors. They connect the browser to the (Rails) server via JavaScript and XMLHttp. There are two classes, both in the same .js file: RailsConnector, and JsonConnector. They can be used Synchronously or Asynchronously.

In the aforementioned blog post, I talk a bit about the API — but the source is actually fairly well commented. It even has a couple of usage examples. So what are you waiting for? Download it!

connectors.js(8 KB)

You can use this script however you like. So have a look at it, kick the tires. I only ask that if you find any bugs, make any fixes, let me know!


3 comments

03.14.05 @ 14:01 Tech Observer said...
Ajax and Rails: more of a good thing
M@ McCray » AJAX and Rails Anyone working with Ruby right now? a couple of JavaScript classes to aid in using the XMLHttpRequest stuff. I’ve been using them on a little project I’ve…
09.01.05 @ 11:18 ketan said...
Do u have any undergraduation level project running on AJAX
10.23.05 @ 23:59 Aditya Iyengar said...
hi,

i’m new to this Ajax and Rails thing, but got very interested about it when i started researching on such technologies. Can anyone please tell me what Ajax and Rails is? What is it all about and how companies use it?

Thank you

No trackbacks

Trackback link:

Please enable javascript to generate a trackback url


You may use Textile, or simple html tags (B,I). Feel free to use Emoticons too. Oh, and please limit yourself to only five links per comment. Anything more and you'll probably get detained by the spam police.