Skip to content

Instantly share code, notes, and snippets.

View kristindiannefoss's full-sized avatar

kristin dianne foss kristindiannefoss

  • Denver, Colorado
View GitHub Profile
## 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?
Primary key is the id in the table you're working in, the foreign key is the connected key from another table you're
joining or referencing in the current table. The primary key is generated when the table is created. Primary cannot be
repeated in the table. Foreign key is a relationship that is formed, primary key of another table. Name of table_id is
convention for the foreign key.
#### Write down one example of:

Introduction to Sinatra

1. What is the purpose of the server file (routing)?

2. How do you pass variables into the views?

3. How can we interpolate ruby into a view (html)?

4. In what format does data come in from a view/form? What do we call it?