I’ve created a set of routes & controllers with the admin namespace, and I was having some issues using the link helpers with these new routes.
I see that there are some new path helpers, such as admin_projects_path which leads to the /admin/projects. however, i’m having trouble linking to the show, edit, destroy, etc. paths for these objects within the namespace. how do I do that?
You should see all of your routes listed in
rake routesand you can use those by name to get the proper namespacing. Using the automatic detection where you pass in:controllerand:actionmanually won’t work as you’ve discovered.If it’s listed as
new_thingin the routes, then the method isnew_thing_pathwith the appropriate parameters. For instance: