Skip to content

Instantly share code, notes, and snippets.

@andrewdwooten
Forked from case-eee/crud_cfu.md
Last active January 24, 2017 05:41
Show Gist options
  • Save andrewdwooten/8f67a8d1e9d740f9edf9dbf39b264ff1 to your computer and use it in GitHub Desktop.
Save andrewdwooten/8f67a8d1e9d740f9edf9dbf39b264ff1 to your computer and use it in GitHub Desktop.
CRUD CFU Questions
  1. Define CRUD. create, read, update, delete

  2. Why do we use set method_override: true? The comment says it allows us to use '_method' in the form. I'm honestly not quite tracking the flow of things through there.

  3. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>. The name looks like it's a string to identify the name of the box. The value is using ruby ?injection? to call the title method on @task, task object?, and get that value that it was created with to put in the text area.

  4. What are params? Where do they come from? Params are what we get back from user input; they're stored into a hash with keys based on what was entered into the 'name' field of the input areas.

  5. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task? I think it's because you need to use two separate verbs for each of those goals. One each to bring up the correct view for user input and then another to carry out the resulting route from that input.

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