Skip to content

Instantly share code, notes, and snippets.

@saylerb
Forked from Carmer/crud.markdown
Last active May 10, 2016 16:53
Show Gist options
  • Save saylerb/150d53f98ad53c13797409000a69ab4b to your computer and use it in GitHub Desktop.
Save saylerb/150d53f98ad53c13797409000a69ab4b to your computer and use it in GitHub Desktop.
  1. Define CRUD.
  • Create, Read, Update, Delete. Gives us all the behavior to make a fully-functional web application
  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.

  2. GET "/tasks" - displays all the current tasks with the :index view

  3. GET "/tasks/:id" - display a single task with the :show view

  4. GET "/tasks/new" - display the form to create a new task with the :new view

  5. POST "/tasks" - write a task to the database, and redirect back to "/tasks"

  6. GET "/tasks/:id/edit" - display the form for editing an existing task with the :edit view

  7. PUT/PATCH "tasks/:id" - update a specific task in the database with new data, and display the edited task by redirecting back to "/tasks/:id"

  8. DELETE "tasks/:id" - delete an existing task from the database and redirect back to "/tasks"

  9. Why do we use set method_override: true?

  10. Explain the difference between value and name in this line: .

  11. 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