Friday, April 6th, 2007
Jester: JavaScriptian REST
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):
-
-
Base.model("User")
-
Base.model("Child", "http://www.thoughtbot.com", "child", "children")
-
-
var eric = User.find(1)
-
//GET http://localhost:3000/users/1.xml
-
-
var floyd = User.create({name: "Floyd Wright", email: "tfwright@thoughtbot.com"})
-
//POST http://localhost:3000/users.xml
-
-
var chad = User.build({email: "cpytel@thoughtbot.com", name: "Chad Pytel"})
-
chad.new_record()
-
chad.save()
-
Holy client-side programming batman!
( via Alex MacCaw )












Leave a comment