Which verb?: Take a bus or take the train

Assume that at some point in the user’s processing we come to a page in
which the user is to select from one of several choices that will then
determine which processing will happen on the next page … perhaps
putting up a bus route map if she selects “bus” and a train schedule if
she selects “train”.

What RESTful verb should I use to indicate this kind of choice? Show?

2010/1/19 Ralph S. [email protected]:

Assume that at some point in the user’s processing we come to a page in
which the user is to select from one of several choices that will then
determine which processing will happen on the next page … perhaps
putting up a bus route map if she selects “bus” and a train schedule if
she selects “train”.

What RESTful verb should I use to indicate this kind of choice? Show?

Possibly a choices controller with action show as you suggest.

Colin

Colin L. wrote:

2010/1/19 Ralph S. [email protected]:

Assume that at some point in the user’s processing we come to a page in
which the user is to select from one of several choices that will then
determine which processing will happen on the next page … perhaps
putting up a bus route map if she selects “bus” and a train schedule if
she selects “train”.

What RESTful verb should I use to indicate this kind of choice? �Show?

Possibly a choices controller with action show as you suggest.

I’m not sure a separate controller is called for. In some cases it may
make more sense to do show?transport=train , or to simply define
nonstandard REST actions bus and train.

Remember, the 7 basic REST actions are merely convention. If they do
not map well to your resources, there is nothing wrong or unRESTful with
defining custom actions.

Colin

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Colin L. wrote:

2010/1/19 Ralph S. [email protected]:

Assume that at some point in the user’s processing we come to a page in
which the user is to select from one of several choices that will then
determine which processing will happen on the next page … perhaps
putting up a bus route map if she selects “bus” and a train schedule if
she selects “train”.

What RESTful verb should I use to indicate this kind of choice? �Show?

Possibly a choices controller with action show as you suggest.

Colin

Colin, thank you.

Can you point me at what a “choices controller” looks like?

Ralph

On Tue, Jan 19, 2010 at 12:39 PM, Ralph S.
[email protected]wrote:

Possibly a choices controller with action show as you suggest.

Colin

Colin, thank you.

Can you point me at what a “choices controller” looks like?

Ralph

Ralph, you can look at a web page as being the current state and the
links on page can represent the transitions between your states (i.e.
web
pages). Thus, in the past, I have created wizards which used an
underlying
state machine which worked out well. Finally, Mike Hagedorn wrote
recipe 16
in
“Advanced Rails Recipes” which demonstrates the usage of the
acts_as_state_machine
gem.

Good luck,

-Conrad