Reputation: 137
I want to have to url /pc/group/1 point to views/groups/show.html.erb. I'm not sure how to do this. I tried the following:
namespace :pc do
resources :groups
end
resources :pc
But it results in can't find the page.
Upvotes: 0
Views: 35
Reputation: 13354
You'd tell the route which controller and action to use in this situation:
namespace :pc, controller: 'groups' do
resources :groups
end
resources :pc
Note that doing it this way, all routes for /pc/groups will point to the GroupsController
, not just show
.
Upvotes: 2