Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brennanholtzclaw/220b6dac31c773bec7a1 to your computer and use it in GitHub Desktop.
Save brennanholtzclaw/220b6dac31c773bec7a1 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?
    ** So that the browser will know to look for a hidden verb (not post or get) and overwrite is with the "_method" verb **
  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
    ** Name here is the title of the task in the "name" section, in value it's a Ruby evaluated bit of code calling for the title from a task instance variable. **
  5. What are params? Where do they come from?
    ** That's the parameters, taken from the end of the request url **
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment