| Length | Points | Week |
|---|---|---|
| 20 minutes | 10 | Week 2 |
When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.
rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T-d postgresql sets up the project to use PostgreSQL--skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring-T skips the creation of the test directory and use of Test::Unit##Leap My code: here
Responder #1 (here) - This responder defined new variables for each condition check rather than the if/return I chose.
Responder #2 (here) - This person also used the if/return conditionals, but separated the last condition in a separate check.
Responder #3 (here) - This user did an explicit check for every condition.
##Hamming My code: here
| ## 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 /> |
###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
Acts as a gateway. Takes request and parses any logic and displays, renders or redirects as code indicates.
Variables can be passed into views by setting instance variables or sending local variables that can be referenced in your erb view files respectively.