RESTful routes with :has_many

Hello, I don’t know if this is a bug or a feature. When defining
routes like:

map.resources :as, :has_many => ‘bs’
map.resource :b, :has_many => ‘cs’
map.resource :c

I get:

new_b_c GET /b/cs/new {:controller=>“cs”, :action=>“new”}

yet I want:

new_b_c GET /bs/:b_id/cs/new {:controller=>“cs”, :action=>“new”}

which I get with adding:

map.resources :bs, :has_many => ‘cs’

Is this supposed to be this way?
Thank you, regards Christoph

On Sep 18, 8:32 am, Christoph_Petschnig [email protected] wrote:

yet I want:

new_b_c GET /bs/:b_id/cs/new {:controller=>“cs”, :action=>“new”}

which I get with adding:

map.resources :bs, :has_many => ‘cs’

Is this supposed to be this way?
Thank you, regards Christoph

I think you want to use map.resources, not map.resource, in all of
those.

Jeff

REST with Rails: $295, Oct 4, Austin, TX:
http://www.purpleworkshops.com/workshops/rest-and-web-services
Discount code “PWRRGG” => 10% off