Skip to content

Instantly share code, notes, and snippets.

@vanderhoop
Last active August 29, 2015 14:13
Show Gist options
  • Save vanderhoop/c7e250284e3b6433f51e to your computer and use it in GitHub Desktop.
Save vanderhoop/c7e250284e3b6433f51e to your computer and use it in GitHub Desktop.

The DMV

The DMV is notorious for making you fill out numerous forms. You are going to recreate that hellish process for users of the California DMV's web application.

DMV Part 1

  1. Write a route handler for GET requests made to "/first_form". Make this route render a template called first_form.erb.
  2. Within first_form.erb, make a form. Make the form POST to "/first_form".
  • give the form inputs for the user to enter their name and drivers license ID number
  1. Write a route handler for POST requests made to "/first_form".
  • put a binding.pry in the route handler and use redis's hmset method to persist a hash called user, and persist the user's name and drivers license ID number.
  • you can use redis's hgetall method to make sure that your info has been persisted, then redirect to "/second_form"

DMV Part 2

  1. Write a route handler for GET requests made to "/second_form". Make this route render a template called second_form.erb.
  2. Within second_form.erb, make a form that POSTs to "/second_form".
  • give the form two inputs: one for the user's date of birth and the other for the user's sex.
  1. Write a route handler for POST requests made to "/second_form".
  • make the route handler persist the user's date of birth and sex, then have it redirect to "/third_form"

DMV Part 3

  1. Write a route handler for GET requests made to "/third_form". Make this route render a template called third_form.erb.
  2. Within third_form.erb, make a form that POSTs to "/third_form".
  • give the form three inputs: one for the user's height and the other for the user's weight.
  1. Write a route handler for POST requests made to "/third_form".
  • make the route handler persist the user's height and weight, then have it redirect to "/waiting_line"
  1. Write a route handler for GET requests made to "/waiting_line". Make this route render a template called waiting_line.erb.
  2. Make the waiting_line.erb template tell the user that they are in line and will be seen anywhere between the next 2 to 6 hours.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment