- 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.
- a. GET '/tasks' See all tasks
- b. GET '/tasks/:id' See a single task
- c. GET 'tasks/new' See form to enter a new task
- d. POST '/tasks' Submit data to create a new task
- e. GET '/tasks/:id/edit' Pull up a form (for specific id) in order to edit
- f. PUT '/tasks/:id' Submit data (for specified id) from edit
- g. DELETE '/tasks/:id' Delete a task
- Why do we use set method_override: true?
- method_override allows us to use PUT and DELETE since GET and POST are the only default verbs.
- Explain the difference between value and name in this line:
<input type='text' name='task[title]' value="<%= @task.title %>"/>
.
- The name is outside of the box and is a set value, the value is what appears in the box (our actual data).
- What are params? Where do they come from?
- Params is a hash that represents our database. Each item inside params is a hash that contains our data.
Ready to be checked