Status: Beta

See something that looks weird or doesn't make sense? Let us know! https://tinyurl.com/rails-fa18-feedback

Welcome to Week 6's Lab!

By this point of the Rails Decal, you now have the full power of Models, Views, and Controllers. You've learned about editing your database schema, associating models, validating data information, as well as the all-powerful scaffolding tricks.

Today we're going to be working with a simple task: creating a university and student roster.

Run whales new models_lab calblueprint/whales-snap and let's get started :)

Note: whales-snap is in beta and allows you to start a new Whales project in < 1min - please post in #techwoes if you see any weirdness!

TOCCD (The official cross-campus database)

Universities all across the U.S. are struggling to adopt new technologies. If you've ever tried registering for a class on campus, you know that our software could use some updating. Recently several chancellors of colleges across the nation are came together and decided to create a collective database of their all their students. They picked the ROR Decal to build it for them!

With today's lab, we'll be putting together everything we've learned so far in the course to create this for them. This time though, we'll have to be comprehensive in our tasks, ensuring that students can be distinguished based on the college they go to and we be able to edit their information efficiently.

We won't be giving you anything to start off with - just a few components along the way.

Let's get to it

Task 1: Brainstorming a schema and generating our models

As always, the first thing we want to do is plan ahead with our schema and models. In this case, we have two distinct models: Student and University . Here are the properties we've been told we need on these models:

Not only do we need these models, but we also want all the routing and controller methods done for showing, creating, updating, and deleting both kinds of objects. The previous homework had you walk through this piece by piece - filling in the controller methods, editing your routes, and syncing them up with the model. Since a lot of these tasks end up being repetitive, Rails gives us a powerful generating tool: scaffold