Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marinacor1/79fc6d578c8467f86c18 to your computer and use it in GitHub Desktop.
Save marinacor1/79fc6d578c8467f86c18 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. GET -retrieves info that comes in request POST - creates a new piece of information from the request PUT - updates specific information that is in the request DELETE - deletes a specific resource that is identified

  3. Why do we use set method_override: true? It overrides the current method and allows us to use the method in the form.

  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>. name gives a title value assigns a variable

  5. What are params? Where do they come from? params come from the YAML file and are a hash where you pull info

@Carmer
Copy link

Carmer commented Mar 23, 2016

:(

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