Homework for 9A

Review

Topics Covered: Rails relations; associating two models;


Exercises

E1: Relation Review

  1. Why do we use relations? What are they good for?
  2. Will you ever write a relation on just one class, or will a relation always join two classes together?
  3. What types of relations did we learn about? What makes them unique? Can you give examples of each? Hint: We learned about 4 different kinds and an extension.
  4. What changes do you have to make to migrations and models for each relation?

E2: We Belong Together

What kind of relations would you use for each of the following models?

  1. Tweets and users
  2. Users and accounts
  3. Tweets and hash tags
  4. Stores and customers
  5. Shopping carts and items
  6. Shoppers and Carts
  7. Shopper and items in the cart that the shopper has

E3: MeowBook: Bigger. Better. Purrfecter.

Rebuild MeowBook. Create User and Post from scratch, without using scaffolding. This should include functionality to create new users/posts, and see all of the posts. Make User and Post related in a way that makes sense, so that posts can display their user's name.

We know that this is a solid amount of work in the middle of your proposal process, but the only way to learn Rails is through repeated practice. This means taking the time to try things out by yourself, which is why we are having you repeat the process of creating an app from scratch again.

Project


Proposal Submission

Your final project proposal is due at 10 pm on Monday. The requirements for this proposal are in the previous lecture. Please make sure you pay special attention to the Code briefing section. Scoping out your project early in the process will give you a great perspective on how to go about actually coding your application. If your plan is clear, coding won't be hard ;)

You will be meeting with Micah at some point over the weekend to discuss your proposal and get feedback on it. Please try to have most of your proposal done by then, especially the Coding section.
The deadline to submit stands at midnight on Monday .