ChangesInRails30

This is a work in progress

Once complete, this page is intended to show changes in Rails 3.0 that affect the sample code in Agile Web Development with Rails, Edition 3. As page numbers in the paper and PDF copies differ, this information is organized first by section number, then it lists both page numbers, paper copy first.

Meanwhile, a live status of an updated Edition 3 scenario (as well as a developing Edition 4 scenario) under various versions of Rails and Ruby is available. Note that page is based on pulling Rails from git (and for 1.8.8 and 1.9.2, Ruby from svn) so it will often reflect failures that will not ever make it in beta or RC form.

Global changes

The names of scripts have changed:

Rails 2.2

Rails 3.0

rails

rails new

ruby script/about

rake about

ruby script/console

rails console

ruby script/dbconsole

rails dbconsole

ruby script/destroy

rails destroy

ruby script/performance/benchmarker

rails benchmarker

ruby script/performance/profiler

rails profiler

ruby script/generate

rails generate

ruby script/plugin

rails plugin

ruby script/runner

rails runner

ruby script/server

rails server

3.0 Installing Rails

Page 21/32: Rails now requires Ruby 1.8.7 or later.

3.2 Installing on Windows

Page 21/31: As InstantRails bundles Ruby 1.8.6, it is no longer a viable starting point for Rails 3.0 usage. Try one of the following alternatives:

Page 431/436: some of these examples return /blog/show_date?... instead

Page 433/427: overwrite_params is no longer supported. To get the same effect, you now need to specify each parameter.

21.4 Testing Routing

Page 455/459: the excerpt in the book doesn’t show it, but if you download routing_conditions_test.rb and wish to execute it, you will need to add require "config/routes_with_conditions.rb" to the beginning of config/routes.rb. After this is done, you can remove the setup method entirely from RoutingTest as it is unnecessary.

23 Action View

Page 505-560/508-562 Every example of the form <% ... do %> needs to be converted to <%= ... do %>

23.3 Helpers for Formatting, Linking, and Pagination

Page 518/521: A new version of the will_paginate gem is required, and the installation instructions have changed: