0

I was reading Rails routes guide and came to this part:

If you want to route /posts (without the prefix /admin) to Admin::PostsController, you could use:

scope module: 'admin' do
  resources :posts, :comments
end

Ok I understood this part, it says if we use scope the way it shows us, instead of for example /admin/posts we can directly say /posts

But I didn't underatand the second part below: What does this one do?

If you want to route /admin/posts to PostsController (without the Admin:: module prefix), you could use:

scope '/admin' do
  resources :posts, :comments
end
4

1 に答える 1