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 Read Action Linking to Model Objects

Embed a link in this template's output using the link_to method. The link text should say "List of all Pets", and the li

Embed a link in this template's output using the link_to method. The link text should say "List of all Pets", and the link path should be "/pets".

app/views/main.html.erb

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

Alejandro, did you watch the videos carefully? Please paste some code that you tried that didn't work - this will tell us that you've put some effort into the task and what your problem is exactly.

Caitlin Palmer-Bright
Caitlin Palmer-Bright
11,310 Points

I thought I was struggling with this about 20 minutes ago, before realising I'd just added an extra comma! But the example in the video is very close - see what they type in each section of the ERB vs what appears on the page when it loads

1 Answer

mahdi mostafa
mahdi mostafa
9,750 Points

This is what it is asking you to write for anyone in the future who comes across to this page: <p><%= link_to "List of all Pets", "/pets" %></p>