-
Define CRUD. All the functionality expected from a database application: 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 /tasks shows all of the tasks
-
get /tasks/:id shows a single task
-
get /tasks/new show form to make a new task
-
post /tasks makes a new task
-
get /tasks/:id/edit shows form to update a task
-
put /tasks/:id updates a specific task
-
delete /tasks/:id deletes a task
-
Why do we use
set method_override: true
? It lets us use hidden methods to replace a post with put or delete -
Explain the difference between
value
andname
in this line:<input type='text' name='task[title]' value="<%= @task.title %>"/>
. Name is what the input is called, while value is the content of the input box that the user sees -
What are
params
? Where do they come from? Params are information from the request; they are in the url for a get and are in the body for a post.
Forked from rwarbelow/cfu_crud_in_sinatra.markdown
Last active
February 3, 2016 20:12
-
-
Save julyytran/4859d3dea79c63cf6834 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
params[:name]
)