Exercise Monday

Goal: Set up Active Record in your project, use migrations to set up your database and practice using the built-in query and associations capabilities of Active Record.

Warm Up

  • What is an ORM and how does Active Record work?
  • What is a migration? What can be accomplished with migrations?
  • What is an MVC framework and how is Rails an MVC?


Record Store Application

Follow along with the weekend homework and build out a record store application using Rails.

Wildlife Tracker

The Forest Service is considering a proposal from a timber company to clear-cut an old-growth forest outside of Portland. Before they give the go-ahead, they need to do an environmental impact study. They've asked you and your pair to build an app so that the rangers can report wildlife sightings.

  • Start out by letting users CRUD/L (create, read, update, destroy, list) animals.
  • Next, allow them to input a sighting of an animal, along with the date, latitude, and longitude. (Hint: an animal has many sightings.) Add CRUD functionality for these sightings.
  • Now the area under consideration has been divided into several regions. Build out CRUD/L functionality for regions, and when a user reports a sighting, have them choose the region from a drop-down menu. (Hint: do a web search for html drop-down mdn.)
  • Bonus: let users run reports to list all the sightings during a given time period.
  • Extra Bonus: let users narrow their reports down to a particular region.

Team League

Create an app to manage a league with teams and tournaments. You can decide what kind of league will be your client. Possible ideas include a sport of some sort: high school basketball, college foosball, bobsledding; a game of some sort: chess, board games, tiddlywinks, community laser tag; an activity of some sort — relay racing, ice sculpting, snail racing, country line dancing.

  • As the league manager, I want to add, update, delete and list teams.
  • As the league manager, I want each team to have a team coordinator so I have a single point of contact for that team.
  • As the team coordinator, I want to add, update, delete and list players on my team so I can keep track of who is currently on it.

Further Exploration

  • As the league manager, I want to set up games between teams so I can keep track of scores and win-loss records.
  • As the league manager, I want to generate a tournament that pits the top teams against each other based on their records. (Hint: Pick an even number like 8 or 16 so every team in the tournament always has a match.)

Peer Code Review

  • Does code follow Rails convention?
  • Is the code well-refactored and easy to follow?
  • Does the application work as expected?

Lesson 16 of 34
Last updated August 7, 2022