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 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!