- 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
- What routes would be provided to you with the line
resources :items
?
- it adds crud + index/show functionality for the items path
- 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
- 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
- How would you interpret this output:
items GET /items(.:format) items#index
- name of the route, verb, relative path, optional file extension, controller action
- What is one major similiarity between Rails routing + controllers and the Sinatra projects we've been building?
- crud functionality looks the same
- What is one major difference between Rails routing + controllers and the Sinatra projects we've been building?
- much simpler syntax