Skip to content

Instantly share code, notes, and snippets.

View boomer's full-sized avatar

Michael Boomershine boomer

View GitHub Profile
@g1na1011
g1na1011 / c2wk2rails_quiz.md
Last active December 25, 2015 06:29
Below are the answers to our second week's Rails quiz from Course 2 of Tealeaf Academy (regarding routes, helpers, partials, validation, model backed vs. non-model backed forms, etc.).

Rails Week 2 Quiz

  1. Name all the 7 (or 8) routes exposed by the resources keyword in the routes.rb file. Also name the 4 named routes, and how the request is routed to the controller/action.
  # Assuming you are getting resources :posts
  
  $ rake routes
  
  get '/posts', to: posts#index                => posts_path
  get '/posts/object', to: posts#show          => post_path(object)
  get '/posts/object/edit', to: posts#edit => edit_post_path(object)