Skip to content

Instantly share code, notes, and snippets.

View deborahleehamel's full-sized avatar

Deborah Hamel deborahleehamel

View GitHub Profile
@deborahleehamel
deborahleehamel / git_commit_messages_helper.md
Last active February 13, 2018 21:11
Proper git commit messages

Proper git messages - Rules and examples

##The seven rules of a great git commit message

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how
## 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 original id generated when a table is created. <br />
Foreign key is the relationship to another object in another table and is formatted with ending _id.<br />
#### Write down one example of:
* a `one-to-one `relationship.
one person has one social security number<br />
@deborahleehamel
deborahleehamel / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:23 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding

###Define CRUD.

C - Create R - Read U - Update D - 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.

GET/tasks

Introduction to Sinatra

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

Acts as a gateway. Takes request and parses any logic and displays, renders or redirects as code indicates.

2. How do you pass variables into the views?

Variables can be passed into views by setting instance variables or sending local variables that can be referenced in your erb view files respectively.

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