RESTful Thinking

Okay, so I am trying to embrace the RESTful approach to web
application design and wanted to get some feedback from others. I
understand that it can be done different ways, I’m just interested to
see what real RESTful theorists think. Lets say that you have an
application that has lists and items on that list. I can see how both
lists and items can be set up as resources. Now, lets say you want to
have an action to both show you the current sorted list* and then
allow you to save a new sort. You would need a custom GET action to
“show_sort” and a PUT or POST to “save_sort”.

map.resources :lists :member => {:show_sort => :get, :save_sort
=> :put}

or

map.resources :items :collection => {:show_sort => :get, :save_sort
=> :put}

This just seems weird. Neither look great or feel RESTful. The
resource you are interacting with is really the item_sort, but I can’t
imagine people would create a model for that? Am I over thinking
things? What would other people recommend in this scenario?

Thanks,
Tom

  • Ideally you could show the sort and make modifications right on the
    show action of the list, but for discussion lets assume a separate
    action is required.

It’s not clear to me what your goal is? Can you explain it again?