Skip to content

Instantly share code, notes, and snippets.

View drew-t's full-sized avatar

Drew Thompson drew-t

View GitHub Profile

Setting Group Expectations

Group Member Names:

  1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed?

Everyone is generally available to work at any time. Drew would prefer to leave earlier when possible. Ali needs to run home and let dog out occasionally after school.

  1. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?
## 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 can only appear once in a table, foreign key points to an object with a primary key in another table. Primary key is normally called id in postgres.
We would find a foreign key when we reference an object from another table. naming convention: table_id
#### Write down one example of:
* a `one-to-one `relationship.
@drew-t
drew-t / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:26 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD. CRUD stands for Create, Read, Update, and Delete. These are the main functions that we can do to data.
  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. get + /tasks: Read all tasks get + /tasks/:id: Read specific task get + /tasks/new: get form to fill out new task post + /tasks: Create a new task get + /tasks/:id/edit: See form to edit task info put + /tasks/:id: change task delete + /tasks/:id: delete a task

Introduction to Sinatra

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

The server file takes in the requests from clients and calls on the appropriate logic/views to send back a response to the client.

2. How do you pass variables into the views?

You can pass instance variables, or you can pass a local variable by passing it via :locals in erb.

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