Lab Exercises

These are recommended exercises you can do inside the Rails command-line console. But first, you will need to set up the model and scaffold for your first project.

Most of this content is summarized in chapter 4. You may also want to refer to the online ActiveRecord documentation. It may appear intimidating at first, but the more you try to use it, the more helpful this kind of documentation will become.

Exercises at the command-line console

  1. Using your model class, create a new data object
  2. Assign values to the object's properties
  3. Save the object
  4. Use find to retrieve objects
  5. Modify, resave and delete objects
  6. Use the find_by_property method to search for specific data objects
  7. Verify that the new data objects have been added to the database by running your application.

In addition to these exercises, you can work on the first project and plan out goals for the design of your web application.