-
Define CRUD.
-
Why do we use set method_override: true?
-
Explain the difference between value and name in this line:
<input type='text' name='task[title]' value="<%= @task.title %>"/>.
-
What are params? Where do they come from?
-
Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
-
-
Save case-eee/1f066fa3be100f8f18f4d31f521a3da4 to your computer and use it in GitHub Desktop.
CRUD CFU Questions
liambarstad
commented
Aug 14, 2017
- Create, read, update, destroy = the concept that each element of a database needs to be able to be created, read, updated, and destroyed through the controller/view
- it allows you to call methods in your controller that are otherwise unable to be interpreted by HTML
- name='task[title]' is implying that the value of this text input will be the value for "title" in the parameter hash, value="<%= @task.title %>"/> is implying that the default value of this text box will be the title associated with the ruby object "task"
- params are values taken from the HTML, whenever an input or value has a name="..."
- the /edit route and the /new route both make different requests to the SQL database through the ruby class Task.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment