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: true
option 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With