Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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