Skip to content

Instantly share code, notes, and snippets.

@Jbern16
Forked from rwarbelow/cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:10
Show Gist options
  • Save Jbern16/da70c945f79f76bf5c0d to your computer and use it in GitHub Desktop.
Save Jbern16/da70c945f79f76bf5c0d to your computer and use it in GitHub Desktop.
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD. create, read, update, delete

  2. 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. read: get, read: get, create: get, create: post, update: get, update: put, delete:, delete

  3. Why do we use set method_override: true? to set the form to put or delete instead of the default value of post. We override the verb.

  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>. name is the param. Value is the title of the task object

  5. What are params? Where do they come from? series of key-value pairs that are retrieved from the user's browser. (the url)

@Carmer
Copy link

Carmer commented Mar 23, 2016

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment