« Transformation: Ruby Smells | Main | Wiki vs. Blog »

Chapter 7: Ruby on Rails

Rails feels like just what it is, a reflective inspection and auto build (aka code generation) of a well designed Model View Controller connected to a nice implementation of Martin Folwers Active Record design pattern. I think the lession here isn't how great Rails is, but how much can be gained by following well designed patterns...

[This chapter is littered with syntaxical errors, and appearently Rails scaffolding writes different code than when the book was writen. Read carefully and watch the purals and you'll get through it. This chapter is also the most fun so far. Take Rails for a test drive.]


  • Install Rails

    • Starting a Rails Project

      • Generating a Basic Application
      • Running the Ruby webserver


  • Install MySQL?

    • Create a sample database and table

  • Metaprogramming (Wire the app up to a MySQL? DB)

    • Config the database.yml (yaml) file to work with your MySQL? database
    • Restarting the server

  • Generating the Model
  • Using the Application Console
  • Generating the Controller
  • Managing Relationships
  • Generating Scaffolding
  • First look at WEBrick and ActiveRecord?

    • Automatic properties
    • Association Management

      • belongs_to
      • has_many

    • Componsition
    • Inheritance * Modifying the Views * Modifying the Controllers



[Rails feels like just what it is, a reflective inspection and auto build (aka code generation) of a well designed Model View Controller connected to a nice implementation of Martin Folwers Active Record design pattern. I think the lession here isn't how great Rails is, but how much can be gained by following well designed patterns. Imagine if they implement ten or twelve of the other classic patterns that fit the web app model. Good reflection and the dynamic nature of Ruby help them implement these, but Groovy or any other language can benefit from the same treatment.]