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 Adding a Route

Karen Ho
Karen Ho
10,190 Points

We're back in our veterinarian app. Route all GET requests for the /pets path to the PetsController's index action metho

My answer doesn't seem to work, please help!

routes.rb
Rails.application.routes.draw do
  # YOUR CODE HERE
  GET '/pets', to: 'PetsController#index'
end

1 Answer

You need to use lower case and you don't need to add the word 'controller' as rails does it automatically.

This should pass....

Rails.application.routes.draw do
  # YOUR CODE HERE
  get '/pets', to: 'pets#index'
end