Lesson Weekend

In this course section, we will begin using Rails and Active Record. Rails is an MVC framework that allows us to quickly bootstrap our applications. Active Record is an ORM (object-relational mapping) library that uses naming conventions to configure much of the interactions between our objects and the database tables that back them.

In this section, we will cover the following:

  • Databases with Models and Active Record
  • Routes and Controllers
  • Rake, a tool for running tasks
  • Queries with Active
  • Associations
  • Validations
  • Scopes
  • shoulda-matchers
  • 'require' shortcuts

In many ways, Rails makes our lives easier. However, it is a monolithic framework that can be difficult to learn at first. Rails will simplify routing while ActiveRecord makes using databases easier. That being said, it is a big jump from Sinatra to Rails. At this point, it shouldn't come as a surprise that this course section is challenging, too. The good news is that we will be working with Rails for the rest of the Ruby class. As always, it's okay if all the concepts don't click at first. We will have three additional course section after this one to improve our Rails skills.

Independent Project Objectives


At the end of this section, you will complete an independent project. Your code will be reviewed for the following objectives:

  • Does the project include thorough unit and integration test coverage?
  • Do routes follow proper convention, including a root route?
  • Does the project have the required validations and callbacks?
  • Does the project have the three scopes specified in the prompt? Are the scopes properly utilized in views?
  • Is the database properly seeded with the Faker gem?
  • Are success and error flash messages used correctly?
  • Project is in a polished, portfolio-quality state.
  • The prompt’s required functionality and baseline project requirements are in place by the deadline.

Lesson 1 of 34
Last updated July 14, 2022