To act accordingingly to whatever is sent to the server.
through instance vairables or locals
Define CRUD. create, read, update, delete
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
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.
Explain the difference between value
and name
in this line: ``.
## Models, Databases, Relationships in Rails | |
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key? | |
We find a primary key as the main identifier of a table. Example: Teachers: TeacherId. A Foreign creates the relationship between tables. | |
Example: Teachers : course_id. The naming convention for these are the table they belong to + "_id" | |
#### Write down one example of: | |
* a `one-to-one `relationship. | |
each person has one toothbrush and one toothbrush has one person. This is modeled by combining both to a single table because they are | |
dependent of eachother |