Git Product home page Git Product logo

actors_and_movies_lab's Introduction

Actors and Movies

Let's make a Ruby on Rails app that allows us to list some of our favorite actors and movies. We should be able to perform all of the CRUD operations on both Actors and Movies. Additionally, we should be able to indicate which actors are in which movies.

Actors and Movies have an interesting relationship because a Movie can have many Actors and an Actor can also have many Movies. This is a classic many-to-many problem. If we try to use a one-to-many relationship we would either limit a Movie to having one Actor or an Actor to appearing in only one Movie.

Things we'll need

One approach would be to decide what we'd need for Actors and Movies separately, and then think about joining them later. Another approach would be to get the relationships setup first and then fill out the rest of your app. I don't know which is better. I took the first approach but I feel dirty admitting it.

For Movies

We'll need routes, a model, and a controller. Look into resources for creating the necessary routes and rails generate (rails g) for creating models (and migrations) and controllers.

For Actors

It will be the same as what you did for Movies, but for Actors this time.

For Actors and Movies

A few things need to happen at this phase. You'll need to make decisions around:

  • setting up the many-to-many relationship in the database and models,
  • setting up the routes and controller actions, and
  • integrating this feature into your UI.

Notes

This assignment is purposely open-ended. You get to take what you learned (right, guys?) in the weekend lab and integrate in the many-to-many relationship that we discussed this morning. On one hand it's nothing too different from what you've done, on the other it's a sizeable lab with many pieces to put together.

The only requirements are that you allow the user to indicate that many actors can appear in a movie and an individual actor can appear in many different movies. How to do that is largely left up to you.

actors_and_movies_lab's People

Contributors

tlicata avatar osogrizz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.