Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Rails Routes and Resources A Route to a Delete Action Rails Resources

Peter Buckwalter
Peter Buckwalter
6,846 Points

Assigning prefixes when using the resources :pages method

When using the resource :pages method to assign the 7 main routes for pages how do you assign prefixes like 'new_page',

1 Answer

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

When you use the resources method, everything is created automatically, including the names for the routes (which decide the names of helper methods like new_page_path). If you don't want to use the default route names, this Stack Overflow post might help.

Peter Buckwalter
Peter Buckwalter
6,846 Points

Ok perfect. Thanks again Jay