Categories
Uncategorized

Ruby on Rails and REST

I’ve spent a little while over the last few days looking at Ruby on Rails. It seems to live up to the claims of its proponents. You can develop applications very quickly indeed, and it’s easy to get a good separation of concerns. If you haven’t played with it before, have a look at the TODO list examples: Making a todo list and Four Days on Rails. Overall, I’m really, really impressed.

I do have one gripe through (hey, it’s software!) and that’s the lack of RESTability. I’m really keen on using REST interfaces where possible, as I’ve found them remarkably easy to reuse. Ruby appears to go some way towards this, by focusing on a very nice clean URL structure. But one key aspect is missing: dispatch on method names. As Mark Nottingham pointed out, to get a good RESTful interface, you need to dispatch on both URI and method name.

The good news is that Ruby is architected really well, so to get this kind of behaviour should simply be a case of subclass ActiveController::Base or perhaps the Dispatcher itself. I dunno. But it looks eminently doable.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s