Probably the most important change in the next version of Ruby on Rails, 1.2, will be its embracing of the REST style of developing web applications. I started learning about Rails and REST at the same time and quickly got excited about both of them so in my opinion is a great thing that we can now get the benefits of both at the same time.
Just as a quick summary:
- REST is about using the full power of HTTP, which is a lot more that most of us thought. URLs should point to resources and the HTTP verbs (GET, POST, PUT, DELETE) should be used with a meaning.
- Ruby on Rails is a web development framework developed with the Ruby language. It comes with its own development environment and provides libraries for the whole stack from the frontend to the database backend. It's motto is to use convention over configuration and I can tell you that it really pays of.
And now about the REST implementation that will be available when Rails 1.2 comes out. It makes it possible to have URLs like these:
POST /people GET /people/1 PUT /people/1 DELETE /people/1
That will be automatically handled by the following Controller:
class PeopleController < ActionController::Base #POST /people def create() end #GET /people/1 def show() end #PUT /people/1 def update() end #DELETE /people/1 def destroy() end end
Those of you reading this that already know about the goods of REST will see right away the elegancy and benefits of this approach. For the rest of you I strongly recomend viewing the video of the presentation by Rails creator, David Heinemeier Hansson. Ah! don't forget to read the slides of the presentation while watching the video.
Of course the example above is just the beginning. There is not only more to creating REST applications but also yet another wonderful related innovation called ActiveResource. But I'll let you find it out by yourself. Just to help a bit, you can start off with my list of articles about Rails and REST.