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 trialPRAKASH ANAND
Courses Plus Student 5,060 PointsYour route's path needs to include an "id" URL parameter.
Your route's path needs to include an "id" URL parameter.
Rails.application.routes.draw do
# YOUR CODE HERE
get '/pets/', to: 'pets/3'
get '/pets/:id', to: 'pages/27'
end
1 Answer
Dillon Wyatt
5,990 PointsRails.application.routes.draw do
# YOUR CODE HERE
get '/pets/', to: 'pets/3'
get '/pets/:id', to: 'pages/27'
end
https://guides.rubyonrails.org/routing.html
I think the resource above might help you.
A Rails Route includes a few basic parts and I think you are confusing one of them.
A METHOD (GET, POST, etc) A PATH ('/url-address/') A CONTROLLER + ACTION (to: 'pets#show') An ALIAS (as: 'pet')
An ID param would aid you in getting to the individual pet show. I am not exactly sure what the test wants but maybe
get '/pet/:id', to: 'pets#show', as: 'pet'