Friday, April 6th, 2007

Jester: JavaScriptian REST

Category: JavaScript, Library

The nice giant robots have smashed away a JavaScript REST implementation that is inspired by the Rails ActiveResource library.

Jester builds on Prototype and ObjTree, a nice DOM parsing engine for JavaScript.

Take a peak at how it works via the examples (run in Firebug):

javascript

  1. Base.model("User")
  2. Base.model("Child", "http://www.thoughtbot.com", "child", "children")
  3.  
  4. var eric = User.find(1)
  5. //GET http://localhost:3000/users/1.xml
  6.  
  7. var floyd = User.create({name: "Floyd Wright", email: "tfwright@thoughtbot.com"})
  8. //POST http://localhost:3000/users.xml
  9.  
  10. var chad = User.build({email: "cpytel@thoughtbot.com", name: "Chad Pytel"})
  11. chad.new_record()
  12. chad.save()

Holy client-side programming batman!

( via Alex MacCaw )

Posted by Dion Almaer at 5:45 am
Comment here

+++--
3.4 rating from 37 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.