Wondering why my /articles route is not coming up when I apply :shallow => true?
routes.rb
resources :users, :shallow => true do
resources :articles
end
Also tried this:
resources :users do
resources :articles, :shallow => true
end
Visiting /articles won’t show me all articles from any user as expected, but I can still visit /articles/:id just fine. Is this expected behavior?
The
shallow: trueoption does not provide an index resource according to the docs. Therefore, you will not be able to access just/articles. So yes, this is the expected behavior.