1. Jun 27th, 2006

    Rails at it again: REST and ActiveResource

    Turns out Rails 1.2 will be more REST friendly than it already is. Scroll to the second half of this post:

    We’re moving beyond GET and POST in Rails 1.2 – it’ll be done by doing some hacking in terms of setting an HTTP header with the HTTP method we want to actually invoke (since HTML doesn’t actually support PUT and DELETE).

    OK. That’s mildly interesting, mostly a little bit of frameworking around your controller that uses resources and a common set of verbs. So?

    Turns out, good things happen to those who let the framework worry about doing URLs right. (Read Elliotte Rusty Harold‘s post to find out why)

    With Rails 1.2, all you have to do is:

    map.resource '/person'

    Easier that writing this blog post. And with one line you’ve enabled all that is good about the Web, the friendly permalinks, the searching and caching, the quick path to mashing.

    Did I just say mashing? Here’s the other exciting part. Rails 1.2 also brings up ActiveResource, an easy way to create APIs around each of these resources. Two lines of code, and you’re signing and talking Web services.

    If SOA is the next big thing, Rails 1.2 may well make it the next simple things.

    Update: Here’s a link to the presentation (PDF) and the post on Loud Thinking.

    Your comment, here ⇓