- What is the purpose of the router in a Rails project? -It is the doorman to the app, matches the verb to the controller
- What routes would be provided to you with the line
resources :items
? -Get index, Get show, get new, post create, get edit, put update, delete destroy - What does
root :to => "items#index"
represent? How would you access that route in a web app? -it tells the app where to go if the root url is accessed. You would access it like, www.items.com - What rake task is useful when looking at routes, and what information does it give you? -rake routes, outputs all routes available to the app
- How would you interpret this output:
items GET /items(.:format) items#index
-In the items controller, the action is index, making a get request to /items with the option file extension, use the edit route - What is one major similiarity between Rails routing + controllers and the Sinatra projects we've been building? -using RESTful routes
- What is one major difference between Rails routing + controllers and the Sinatra projects we've been building? -rather than explicitly saying what those routes are, we're just doing resources :posts and Rails builds the routes for us
Forked from rwarbelow/intro_to_rails_routing_warmup_questions.markdown
Last active
July 11, 2016 19:17
-
-
Save allindow/6e1504f59ca9553546fc80acf0689c5a to your computer and use it in GitHub Desktop.
Intro to Rails Routing Warm-Up Questions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment