Pelle Braendgaard
2007-May-01 19:53 UTC
Announcing DOM-Resource a new approach to Restful AJAX
Hi Guys, I''ve just published the first attempt at my Restful AJAX library DOM-Resource. http://code.google.com/p/dom-resource/ The idea is to take a rails like DRY approach for dealing with DOM objects and corresponding server resources. It uses the elements DOM id to work out which serverside resource it should map to: people => /people person_1 => /people/1 team_1_people => /teams/1/people team_1_person_1 => /teams/1/people/1 and so on. Rather than create a whole new object hierarchy mapping to this, it extends the corresponding elements with useful methods. It also allows you to extend them easily with your own methods. It does this through the two prototype like functions $RES() and $REC(), which are used to find and work with Collection Resources or Member Resources correspondingly. These methods are called just like prototypes $() function on either an existing element or an id. Thus you can do such things as: $RES(''people'').create({name:''Bubaloo Binx'',email:''bub-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org''}) Which posts to /people and Inserts the resulting server html at the bottom of the people div by default. Individual objects can be accessed like: $REC(''person_1'').destroy() Read more on the Quick Start page: http://code.google.com/p/dom-resource/wiki/QuickStart I''ve also blogged about it at: http://stakeventures.com/articles/2007/05/01/introducing-dom-resource Remember it is early days yet, so there is likely to be issues and major changes coming. Pelle -- http://extraeagle.com - Solutions for the electronic Extra Legal world https://wideword.net - Encrypted wysiwyg document sharing http://stakeventures.com - Bootstrapping blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---