-
-
Save pyk/8718360 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 1) What does MVCr stand for? | |
Model, View, Controller (routes) | |
## 2) In what file do we store 'r' from MVCr ? | |
config/routes.rb | |
## 3) What two components make up a route | |
URL and HTTP verb (GET,POST,PUT,DELETE) | |
## 4) Why are Rails routes REST(ful) ? | |
because it has diferent state in same url path | |
## 5) Match the data operations to the HTTP Verbs | |
[GET, POST, DELETE, PUT] | |
1) Create => POST | |
2) Read => GET | |
3) Update => PUT | |
4) Destroy => DELETE | |
## 6) Fill out the values below based on this log entry: | |
Started GET "/products/new" for 127.0.0.1 at 2012-06-28 11:33:36 -0700 | |
Processing by ProductsController#new as HTML | |
Rendered products/new.html.erb within layouts/application (0.4ms) | |
Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.0ms) | |
Was the request successful, why or why not? succesfull, beacuse it says 200 OK | |
What view file was rendered? products/new.html.erb | |
What path was this request to ? /products/new | |
What Controller was used ? PorductsController | |
## 7) Build a route based on the log entry in the last exercise that maps from the correct url and verb to the correct controller and view. | |
get "/products/new" => "products#new" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment