I have the following routes, which allows for urls like /:username/:project_name
resources :users, :path => "/" do
resources :projects, :path => "/"
end
The problem is that /:username/edit doesn’t work, because it is looking for a project with the name of ‘edit’.
Any way around this? Thanks!
A couple ways of doing this…
1) Will give you routes like
/:user_id/:id(which you wanted)2) Will give you routes like
/:user_id/projects/:id(which it seems like you’re avoiding)I personally prefer #2 since it is cleaner and provides more knowledge about the route at a glance.