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 an Index Action Creating a View

To find a view template...

First question from me here, but I'm stumped. In the quiz for views in the Rails Routes and Resources, the question states:

To find a view template file for the PetsController's "show" action method, Rails will look in the app/views/_________ /___________ .html.erb file. (Fill in the subdirectory and the start of the file name.)

It seems clear to me that the answer is "pets" and "index"

When generated in the previous code challenge, the command used was bin/rails generate controller pets , so the views sub-directory should be pets and the file index.html.erb

So what exactly am I doing wrong?

Thanks in advance for all the help!

1 Answer

The answer is actually pets and show. The pets directory and the show.html.erb. Essentially it's saying show the pets.

I'll be damned. I guess my Google Fu was weak last night. Thanks so much for the help, Ethan!