Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jdliss/423b923cf5be85904e70cd20970b7fe8 to your computer and use it in GitHub Desktop.
Save jdliss/423b923cf5be85904e70cd20970b7fe8 to your computer and use it in GitHub Desktop.
Intro to Rails Routing Warm-Up Questions
  1. What is the purpose of the router in a Rails project?
  • the router finds the correct controller action to use, and provides and error if none is found
  1. What routes would be provided to you with the line resources :items?
  • it adds crud + index/show functionality for the items path
  1. What does root :to => "items#index" represent? How would you access that route in a web app?
  • it will designate the index action as the landing page for that url
  1. What rake task is useful when looking at routes, and what information does it give you?
  • rake routes shows you all the routes in your app
  1. How would you interpret this output: items GET /items(.:format) items#index
  • name of the route, verb, relative path, optional file extension, controller action
  1. What is one major similiarity between Rails routing + controllers and the Sinatra projects we've been building?
  • crud functionality looks the same
  1. What is one major difference between Rails routing + controllers and the Sinatra projects we've been building?
  • much simpler syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment