Am I mapping my routes correctly

I am trying to implement shallow routes (being able to list the index of a model through the parent model but without have to access child records through the parent on other actions than index)

  resources :books, do
    resources :chapters, :shallow => true
  end

the following routes should now be usable,

/books/1/chapters

and

/chapters/6
/chapters/6/edit
/chapters/6/delete

but I get a routing error

No route matches {:controller=>”chapters”}

What am I doing wrong?

I can code it to do /books/1/chapters/6/edit for example but I would rather it use shallow routes.

Comments are closed.