- Define CRUD. gives a web application its full functionality for users with 4 interaction modes: 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. '/tasks' + get: shows all entries '/tasks/:id' + get: shows specific entry by id '/tasks/new' + get: shows/renders form to enter new information '/tasks' + post: creates new entry and redirects to 'tasks/:id' '/tasks/:id/edit' + get: shows entry form with entered information to update information '/tasks/:id' + put: overrides existing entry with new information and redirects to '/tasks/:id' '/tasks/:id + delete: deletes specific entry by id
- Why do we use
set method_override: true
? HTTP expects a post verb whenever we use a form - Explain the difference between
value
andname
in this line:<input type='text' name='task[title]' value="<%= @task.title %>"/>
. name calls on params hash with the key task[title]. Value shows the value of that specific key. - What are
params
? Where do they come from? Params is the hash that input from a form is organized in - with the title of the form field as the key and the content of the field as values
Forked from rwarbelow/cfu_crud_in_sinatra.markdown
Last active
March 23, 2016 04:18
-
-
Save Claudia108/580ad1dcb22d3ccddd13 to your computer and use it in GitHub Desktop.
CRUD in Sinatra -- Check for Understanding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
looks good