:show] do get :goto, on: :member get :enroll, on: :member post :remind_me, on: :member put :notify, on: :member get :suggest, on: :collection resources :reviews, only: [:index, :new, :create, :edit, :update] end 35 Tuesday, May 7, 13
:show] do get :goto, on: :member get :enroll, on: :member post :remind_me, on: :member put :notify, on: :member get :suggest, on: :collection resources :reviews, only: [:index, :new, :create, :edit, :update] end goto_course GET /courses/:id/goto(.:format) {:action=>"goto", :controller=>"courses"} enroll_course GET /courses/:id/enroll(.:format) {:action=>"enroll", :controller=>"courses"} remind_me_course POST /courses/:id/remind_me(.:format) {:action=>"remind_me", :controller=>"courses"} notify_course PUT /courses/:id/notify(.:format) {:action=>"notify", :controller=>"courses"} suggest_courses GET /courses/suggest(.:format) {:action=>"suggest", :controller=>"courses"} course_reviews GET /courses/:course_id/reviews(.:format) {:action=>"index", :controller=>"reviews"} POST /courses/:course_id/reviews(.:format) {:action=>"create", :controller=>"reviews"} new_course_review GET /courses/:course_id/reviews/new(.:format) {:action=>"new", :controller=>"reviews"} edit_course_review GET /courses/:course_id/reviews/:id/edit(.:format) {:action=>"edit", :controller=>"reviews"} course_review PUT /courses/:course_id/reviews/:id(.:format) {:action=>"update", :controller=>"reviews"} courses GET /courses(.:format) {:action=>"index", :controller=>"courses"} course GET /courses/:id(.:format) {:action=>"show", :controller=>"courses"} $ rake routes 35 Tuesday, May 7, 13
enroll_course GET /courses/:id/enroll(.:format) {:action=>"enroll", :controller=>"courses"} remind_me_course POST /courses/:id/remind_me(.:format) {:action=>"remind_me", :controller=>"courses"} notify_course PUT /courses/:id/notify(.:format) {:action=>"notify", :controller=>"courses"} suggest_courses GET /courses/suggest(.:format) {:action=>"suggest", :controller=>"courses"} course_reviews GET /courses/:course_id/reviews(.:format) {:action=>"index", :controller=>"reviews"} POST /courses/:course_id/reviews(.:format) {:action=>"create", :controller=>"reviews"} new_course_review GET /courses/:course_id/reviews/new(.:format) {:action=>"new", :controller=>"reviews"} course_review PUT /courses/:course_id/reviews/:id(.:format) {:action=>"update", :controller=>"reviews"} courses GET /courses(.:format) {:action=>"index", :controller=>"courses"} course GET /courses/:id(.:format) {:action=>"show", :controller=>"courses"} 36 Tuesday, May 7, 13
courses GET /courses(.:format) {:action=>"index", :controller=>"courses"} course GET /courses/:id(.:format) {:action=>"show", :controller=>"courses"} 37 Tuesday, May 7, 13
“index” course_review PUT /courses/:course_id/reviews/:id(.:format) {:action=>"update", :controller=>"reviews"} courses GET /courses(.:format) {:action=>"index", :controller=>"courses"} course GET /courses/:id(.:format) {:action=>"show", :controller=>"courses"} CONTROLLER AND ACTION CHOSEN 37 Tuesday, May 7, 13
REQUEST MADE: GET http://codeschool.com/courses REQUEST ACCEPTED, PASSED TO APPLICATION SERVER APPLICATION SERVER GIVES REQUEST TO MIDDLEWARE, RAILS IS STARTED, GETS REQUEST. 43 Tuesday, May 7, 13
REQUEST MADE: GET http://codeschool.com/courses REQUEST ACCEPTED, PASSED TO APPLICATION SERVER APPLICATION SERVER GIVES REQUEST TO MIDDLEWARE, RAILS IS STARTED, GETS REQUEST. REQUEST PATH AND METHOD MAPPED TO CONTROLLER AND ACTION 43 Tuesday, May 7, 13
REQUEST MADE: GET http://codeschool.com/courses REQUEST ACCEPTED, PASSED TO APPLICATION SERVER APPLICATION SERVER GIVES REQUEST TO MIDDLEWARE, RAILS IS STARTED, GETS REQUEST. REQUEST PATH AND METHOD MAPPED TO CONTROLLER AND ACTION CONTROLLER ACTION GATHERS INFORMATION FROM MODELS TO SUPPLY TO VIEW 43 Tuesday, May 7, 13
STATUS 200 OK === GOOD! 1xx: Informational - Request received, continuing process 2xx: Success - The action was successfully received, understood, and accepted 3xx: Redirection - Further action must be taken in order to complete the request 4xx: Client Error - The request contains bad syntax or cannot be fulfilled 5xx: Server Error - The server failed to fulfill an apparently valid request 46 Tuesday, May 7, 13
STATUS 200 OK === GOOD! 1xx: Informational - Request received, continuing process 2xx: Success - The action was successfully received, understood, and accepted 3xx: Redirection - Further action must be taken in order to complete the request 4xx: Client Error - The request contains bad syntax or cannot be fulfilled 5xx: Server Error - The server failed to fulfill an apparently valid request BODY HTML JSON XML FILE CONTENTS - Image, Video, Compressed file. Set-Cookie: key=value; path=/; 46 Tuesday, May 7, 13
REQUEST MADE: GET http://codeschool.com/courses APPLICATION SERVER GIVES REQUEST TO MIDDLEWARE, RAILS IS STARTED, GETS REQUEST. REQUEST PATH AND METHOD MAPPED TO CONTROLLER AND ACTION CONTROLLER ACTION GATHERS INFORMATION FROM MODELS, SUPPLIES INFORMATION TO VIEW CREATING HTML REQUEST ACCEPTED, PASSED TO APPLICATION SERVER 47 Tuesday, May 7, 13