Skip to content

Instantly share code, notes, and snippets.

@rgbatty
Forked from Carmer/crud.markdown
Last active May 10, 2016 17:32
Show Gist options
  • Save rgbatty/689de082d56237ea0166aadfb68e7d90 to your computer and use it in GitHub Desktop.
Save rgbatty/689de082d56237ea0166aadfb68e7d90 to your computer and use it in GitHub Desktop.
  1. Define CRUD.

Create Read Update Delete - Create an object/program/app, Read in data (from user or from another object), Update Object, Delete when finished.

  1. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  • GET /tasks - Show all tasks
  • GET /tasks/:id - Show a specific task
  • GET /tasks/new - Show a create form
  • POST /tasks - Submit a form and Redirect to /tasks
  • GET /tasks/id/edit - Show an edit form
  • PUT /tasks:id - Update a task
  • DELETE /tasks:id - Delete a task
  1. Why do we use set method_override: true?

To allow us to override a given method with a new method name for the call.

  1. Explain the difference between value and name in this line: .
  2. What are params? Where do they come from?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment