# How to specify a particular action for a resource

**URL:** <https://discuss.rubyonrails.org/t/how-to-specify-a-particular-action-for-a-resource/34988>\
**Category:** rubyonrails-talk\
**Created:** [October 3, 2008, 8:45am UTC](https://discuss.rubyonrails.org/t/how-to-specify-a-particular-action-for-a-resource/34988 "2008-10-03T08:45:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elioncho](https://avatars.discourse-cdn.com/v4/letter/e/ed8c4c/32.png) [@elioncho](https://discuss.rubyonrails.org/u/elioncho)\
**Post date:** [October 3, 2008, 8:45am UTC](https://discuss.rubyonrails.org/t/how-to-specify-a-particular-action-for-a-resource/34988/1 "2008-10-03T08:45:47Z")

</div>

Hello,

I have something like this on my routes:

map.resources :groups do |groups| &nbsp;&nbsp;&nbsp;&nbsp;groups.resources :posts end

map.resources :users do |users| &nbsp;&nbsp;&nbsp;&nbsp;users.resources :posts end

I want only the "index" action available through the groups/posts url. Is there a way to do that.

Thanks,

Elioncho

---

<div class="post-metadata">

**Author:** ![Philip\_Hallstrom](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Philip\_Hallstrom](https://discuss.rubyonrails.org/u/Philip_Hallstrom)\
**Post date:** [October 3, 2008, 6:03pm UTC](https://discuss.rubyonrails.org/t/how-to-specify-a-particular-action-for-a-resource/34988/2 "2008-10-03T18:03:00Z")

</div>

> Hello,
> 
> I have something like this on my routes:
> 
> map.resources :groups do |groups| &nbsp;&nbsp;&nbsp;groups.resources :posts end
> 
> map.resources :users do |users| &nbsp;&nbsp;&nbsp;users.resources :posts end
> 
> I want only the "index" action available through the groups/posts url. Is there a way to do that.

You could remove the methods (ie. actions) from the controller and then they would fail with a 404.

Or you can leave them in there and respond with a 422 "unprocessable entity" status.

Google this list for "unprocessable\_entity" and you'll find more info.
