Skip to content

Instantly share code, notes, and snippets.

@dthtien
Forked from schneems/gist:3029994
Last active May 9, 2017 09:20
Show Gist options
  • Save dthtien/ebaf4bd3f273d703028a5e9284976529 to your computer and use it in GitHub Desktop.
Save dthtien/ebaf4bd3f273d703028a5e9284976529 to your computer and use it in GitHub Desktop.
Databases and Rails Recap Quiz for Week 4
## 1) What does MVCr stand for?
Model View Control Router
## 2) In what file do we store 'r' from MVCr ?
config/routes.rb
## 3) What two components make up a route
Url and verb(Post get put path delete)
## 4) Why are Rails routes REST(ful) ?
## 5) Match the data operations to the HTTP Verbs
[GET, POST, DELETE, PUT]
1) Create Post
2) Read Get
3) Update Put Delete
4) Destroy
## 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? yes becase status is 200
What view file was rendered? product/new.html.erb
What path was this request to ? products/new
What Controller was used ? ProductController
## 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 'product/new', to: "products#new"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment