# Which verb?: Take a bus or take the train

**URL:** <https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882>\
**Category:** Rails\
**Created:** [January 19, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882 "2010-01-19T17:38:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 19, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882/1 "2010-01-19T17:38:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 19, 2010, 5:55pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882/2 "2010-01-19T17:55:55Z")

</div>

2010/1/19 Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 19, 2010, 6:52pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882/3 "2010-01-19T18:52:56Z")

</div>

Colin L. wrote:

> 2010/1/19 Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > 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](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 19, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882/4 "2010-01-19T21:39:45Z")

</div>

Colin L. wrote:

> 2010/1/19 Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > 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

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 19, 2010, 10:26pm UTC](https://www.ruby-forum.com/t/which-verb-take-a-bus-or-take-the-train/181882/5 "2010-01-19T22:26:57Z")

</div>

On Tue, Jan 19, 2010 at 12:39 PM, Ralph S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)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
