- Define CRUD.
- Create Read Update Delete.
- 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 /all - shows everything created
- GET /all/specific - shows a specific thing created
- GET /all/new - gives form to create something new
- POST /all - creates something new
- GET /all/specific/edit - shows something that has already been created but needs to be changed
- PUT /all/sepcific - makes changes
- DELETE /all/specific - deletes
- Why do we use
set method_override: true
? -This allows us to override the standard post method when we need to make a PUT or DELETE request using _method - Explain the difference between
value
andname
in this line:<input type='text' name='task[title]' value="<%= @task.title %>"/>
.
- name is assigning the param and value is filling in the form
- What are
params
? Where do they come from?
- params are key value pairs that come in from a post request or from the end of a url path
/tasks/:id/edit
-- :id is the dynamic parameter.