Hello.
There is an issue with nested resources inside a shallow scope
(kudos to Santiago Pastorino for pointing that out). For example if
you specify this in your routes.rb:
scope '/hello' do
shallow do
resources :articles do
resources :trackbacks
end
end
end
So when you run 'rake routes' you'll end up with
article_trackbacks GET /articles/:article_id/trackbacks(.:format) {:action=>"index", :controller=>"trackbacks"}
POST /articles/:article_id/trackbacks(.:format) {:action=>"create", :controller=>"trackbacks"}
new_article_trackback GET /articles/:article_id/trackbacks/new(.:format) {:action=>"new", :controller=>"trackbacks"}
edit_trackback GET /trackbacks/:id/edit(.:format) {:action=>"edit", :controller=>"trackbacks"}
trackback GET /trackbacks/:id(.:format) {:action=>"show", :controller=>"trackbacks"}
PUT /trackbacks/:id(.:format) {:action=>"update", :controller=>"trackbacks"}
DELETE /trackbacks/:id(.:format) {:action=>"destroy", :controller=>"trackbacks"}
articles GET /hello/articles(.:format) {:action=>"index", :controller=>"articles"}
POST /hello/articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /hello/articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
That is not all URI have a '/hello' prefix. I've attached a
solution here which I hope is ok (also I added a test). Thanks.