How to specify a particular action for a resource

Hello,

I have something like this on my routes:

map.resources :groups do |groups|     groups.resources :posts end

map.resources :users do |users|     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

Hello,

I have something like this on my routes:

map.resources :groups do |groups|    groups.resources :posts end

map.resources :users do |users|    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.