Rails: Do the benefits of using resource based routing to create RESTful controllers outweigh the additional complexity?

I would encourage REST for web services APIs or not. Thinking in terms of resources helps simplify your code and make it more understandable. Coding via convention is a powerful concept and at the heart of rails.It helps that the REST convention is well understood outside of rails.

There will of course be exceptions, but often what you think are exceptions are in fact their own resources. This is the power of the concept. If you run into inconveniences, by all means, define your own route.

The "extra" example you gave is a little fishy, I don't think :put is required for "members". Remember that member methods require a reference to an existing resource.

I would encourage REST for web services APIs or not. Thinking in terms of resources helps simplify your code and make it more understandable. Coding via convention is a powerful concept and at the heart of rails.It helps that the REST convention is well understood outside of rails.

There will of course be exceptions, but often what you think are exceptions are in fact their own resources. This is the power of the concept. If you run into inconveniences, by all means, define your own route.

The "extra" example you gave is a little fishy, I don't think :put is required for "members". Remember that member methods require a reference to an existing resource: link_to "Action", things_extra_url(thing) Collections are often confused with members are defined like: map. Resources :things, :collection => { :extra =>:get } These do not require reference to an existing resource.

Thanks. You're quite right, I left out the reference to the existing resource in the example (edited now). And you're right that the :put is not required - I can use a :get.

But without the :put it isn't RESTful. And if I use the :put in the map then I need it in the link_to. – Greg Feb 3 '10 at 17:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions