-
Define CRUD. C - Create R - Read U - Update D - 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 '/tasks' = reads the index of tasks
- GET '/tasks/:id' = reads the task with the specific id
- GET '/tasks/new' = navigates to a new form for tasks to be entered
- POST '/tasks/' = creates new task in task index
- GET '/tasks/:id/edit' = navigates to specific id to edit task
- PUT '/tasks/:id' = edits/updates task information
- DELETE '/tasks/:id' = deletes a specific tasks
-
Why do we use set method_override: true?
-
Explain the difference between value and name in this line:
<input type='text' name='task[title]' value="<%= @task.title %>"/>.
The value is what the form will be created with as a default value. -
What are params? Where do they come from? Params are the information that a form receives. It is usually treated as a hash.