Reading Related Resources Lab
Setup
For today’s lab, we are going to continue building the Record Collection.
Objective
- Add Songs to our application
- Open your Record Collection project.
- Run the project, and make sure you have the Record#Index, #Show, #New, and #Create actions working.
- If you have been absent or can’t find your project, follow these steps:
- Fork and Clone it from this Starter Repository.
- Build the project (let your instructor know if you receive any errors!).
- Open the database in pgAdmin, and create some records by running the following script (feel free to update the albums and artists to your favorites!).
INSERT INTO albums (title, artist, release_date) VALUES ('Stop Making Sense', 'Talking Heads', '1984-06-24'), ('Banana Winds', 'Jimmy Buffet', '1996-12-06')
- Open the database in pgAdmin, and create some records by running the following script (feel free to update the albums and artists to your favorites!).
- Check out the branch _______ TODO need a branch for after REST & Create Single Resource lessons_____
Create the Song Model and Table
With a partner
- determine how a song relates to an album
- List the changes that need to be made to your application in order to add a song table to our database (using migrations!)
- Implement the song model and table into your application
- When finishied, check in with an instructor before moving on
Write Tests for Songs#Index Action
With a partner
- Create some user stories to describe how a song will be created in your application
- Outline (pseudo-code) the tests that will drive the implementation of the user stories
- Create the tests that you outlined with your partner.
- When finished, check in with an instructor before moving on
Implement the Songs#Index Action and Views
Individually
- Create the Index action that will pull all songs for an album.
- Create the View that will display all songs for an album.
- When finished check in with an instructor!