Skills Assignment 3: Model Basics

Required Demos-n-Deets demos:

Optional demos (for now): Everything else in the “Model Basics” section of the Demos-n-Deets.

Active Reading

Follow the general instructions for active reading for the above required demos.

What to submit:

Important! All screenshots must include your computer’s desktop in the background so that it is recognizable as your desktop. Also, all screenshots of web pages must display the entire URL of the page in the browser’s location bar. (Watch out, as some browsers like to hide parts of the URL unless you click on it.)

Practice Test

Before proceeding, be sure to read the general description and instructions for the practice tests.

Start with the base project on the main branch of this repo: https://github.com/memphis-cs/practice-apps-2021-01spring

Task to perform:

You must implement a Rails model class (including migration) as per this class diagram:

Class diagram of a book class with title string, author string, year integer, and publisher string attributes

You must seed the database (using the seeds.rb script) with the following Book records:

Title Author Year Publisher
Jaws Peter Benchley 1974 Doubleday
Murder on the Orient Express Agatha Christie 1934 Collins Crime Club
Slaughterhouse-Five Kurt Vonnegut 1969 Delacorte
Fahrenheit 451 Ray Bradbury 1953 Ballantine Books
Death on the Nile Agatha Christie 1937 Collins Crime Club

You must create an index page that displays all the Book records stored in the database, like this:

Screenshot of a web browser displaying an index page for books that includes a table with two columns, title and author, and five rows of book records

Each “Show” link on the index page must link to a show page for the record, and the show pages must look like this:

Screenshot of a web browser displaying a show page with a top heading that says Jaws and bullet list of data about the book, including author, year of publication, and publisher

What to submit:

Important! All screenshots must include your computer’s desktop in the background so that it is recognizable as your desktop. Also, all screenshots of web pages must display the entire URL of the page in the browser’s location bar. (Watch out, as some browsers like to hide parts of the URL unless you click on it.)

Explanation Video

Before proceeding, be sure to read the general instructions for the explanation videos.

Start with the base project on the main branch of this repo: https://github.com/memphis-cs/practice-apps-2021-01spring

The video can begin after you have cloned, initialized, and run the base app.

Task to perform:

First, you must imagine a model class of your own invention. Be creative, but also make sure that whatever you come up with makes sense. Additionally, your model class must have the following:

Given this model class, you must implement the following:

Important! Be sure to run and test the things you build in your video (e.g., as per the “Test It!” demo steps).

Time limit: 30 minutes