Skip to content

firstdraft-projects/msm-golden-seven

Repository files navigation

Must See Movies Golden Seven

In this application, users will need to Create, Read, Update, and Delete the following resources:

Director

  • name (string)
  • bio (text)
  • dob (string)
  • image_url (string)

Actor

  • name (string)
  • bio (text)
  • dob (string)
  • image_url (string)

Movie

  • title (string)
  • year (integer)
  • duration (integer)
  • description (text)
  • image_url (string)

You will ultimately build something similar to Photogram Golden Seven, but with different tables/columns.

Use the detailed instructions in the README of the photogram_golden_seven repository as a guide.

Setup

  1. Ensure that you've forked this repo to your own GitHub organization.

  2. Set up a Cloud9 workspace as usual based on your repo.

  3. bin/setup

  4. Run Project

  5. Navigate to the live app in Chrome.

  6. Create all three models and databases table using rails generate model ... at a Terminal prompt as per the Crud with Ruby Cheatsheet.

    To prevent typos, you can copy-paste the following commands:

    rails g model director name:string bio:text dob:string image_url:string
    
    rails g model actor name:string bio:text dob:string image_url:string
    
    rails g model movie title:string year:integer duration:integer description:text image_url:string
    
  7. To actually execute the instructions that you just generated to create the database tables, at a Terminal prompt do

    rails db:migrate
    
  8. Add a few rows to each table through Rails Console or ActiveAdmin (navigate to /admin in the live app and sign in with [email protected] / password).

    Or, alternatively, you can run rails dev:prime from the command line, which will pre-populate ten rows in each table (I wrote a script to save you some typing). (You need to first create all three tables with exactly the column names above in order for this to work.)

  9. Build the Golden Seven to allow users to interact with all three tables through their web browsers. Refer to the README of photogram_golden_seven.

READ

DELETE

CREATE

  • Build a way to see a blank form to add a new row, e.g., by visiting http://localhost:3000/directors/new_form
  • Build the complementary action to receive inputs from that form and actually save them into a new row.

UPDATE

  • Build a way to see a pre-populated form to edit an existing row, e.g., by visiting http://localhost:3000/directors/4/edit_form
  • Build the complementary action to receive inputs from that form and actually update the existing row with them.
  • Note: If you run into an error that talks about "URI too long", that's because the bio is too long to fit in the query string. This is not an error for you to worry about; we'll talk about how to fix it next time. For now, just shorten the bio and re-submit the form.

Rinse and repeat for the other two tables, actors and movies. Good luck, ask lots of questions!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages