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

rake routes in Build a Simple RoR App

I'm going through Laying Out the Page and here's what the screencast says:

"How did I know status_path. Sometimes you want to see all the different helper methods. You do that using "rake routes", it will print out a list of the URLs and methods."

statuses_path was what was used, but I don't see that listed as output from the command. It's said we could have given statuses_url but I don't see that listed also. Just statuses in the first column of the output. So how do we know _path and _url are available? What others are available and how do we know about them?

Thanks!

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey James, that's a built in Rails thing. Any item you see on the left column when running rake routes automatically gets a _path and _url helper method. The path method will do just the path such as "/statuses" and the url with do the full host with the path (eg http://localhost:3000/statuses).

Gotcha, thanks for the reply!

Are there other helper methods?