# REST design question

**URL:** <https://www.ruby-forum.com/t/rest-design-question/190022>\
**Category:** Rails\
**Created:** [June 11, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/rest-design-question/190022 "2010-06-11T15:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orotone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/90db22/32.png) [@orotone](https://www.ruby-forum.com/u/orotone)\
**Post date:** [June 11, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/rest-design-question/190022/1 "2010-06-11T15:41:30Z")

</div>

I have an Item class with archive(), remove(), report() and suspend()  
methods.

I’m trying to decide how to map controllers and actions to each of  
those methods. I can create a separate resource for each method:

resources :items do  
resource :archival  
resource :removal  
resource :report  
resource :suspension  
end

or simple add some extra verbs on the :items resource

resources :items do  
get :archive, :on =\> :member  
get :remove, :on =\> :member  
get :suspend, :on =\> :member  
get :report, :on =\> :member  
post :archive, :on =\> :member  
post :remove, :on =\> :member  
post :suspend, :on =\> :member  
post :report, :on =\> :member  
end

I’m leaning towards the latter because I like the naming convention  
more. archive\_item\_path sounds more intuitive than  
new\_item\_archival\_path

I doubt there’s any definitive answer but can anyone offer their  
opinions as to the advantages/disadvantages of one approach over  
another?

thanks  
Alan

---

<div class="post-metadata">

**Author:** ![orotone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/90db22/32.png) [@orotone](https://www.ruby-forum.com/u/orotone)\
**Post date:** [June 11, 2010, 4:13pm UTC](https://www.ruby-forum.com/t/rest-design-question/190022/2 "2010-06-11T16:13:20Z")

</div>

Archival, removal, report and suspension aren’t really resources…  
they’re actions on an Item.

Option 2 is definitely the preferred approach IMHO.
