This page shows changes in Rails 2.3 that affect the sample code in the book. 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.

8.1 Sessions

  • Page 99/107: the line to uncomment in environment.rb now looks as follows:
    • ActionController::Base.session_store = :active_record_store
  • Page 100/107: The setup is now done in config/initializers/session_store.rb
  • Page 100/108: there no longer is a need to uncomment out the :secret parameter in application.rb (which is now named application_controller.rb)

8.3 Iteration C2: Creating a Smarter Cart

  • Page 106/114: Immediately after calling rake db::sessions::clear (i.e., before any other access to the web server that might create a session), the server (say, WeBrick launched by ruby script/server<code>) needs to be restarted. In some cases, you will have to manually delete the cookie file for it prevents the browser to actually refresh the data set. h4. 8.5 Iteration C4: Finishing the Cart * Page 114/122: After adding the implementation of the total_price method, I found that I had to restart the server in order for this change to be picked up. h4. 11.1 Iteration F1: Adding Users * Page 158/164: The preferred way to order the users returned in the index is now: ** <code>@users = User.all(:order => :name)</code> h4. 11.3 Iteration F3: Limiting Access * Page 166/172: application.rb is now application_controller.rb h4. 11.4 Iteration F4: A Sidebar, More Administration * Page 168/174: application.rb is now application_controller.rb h4. 13.1 Iteration I1: Enabling Translation * Page 190/196: application.rb is now application_controller.rb * Page 200/205: error messages are double escaped. "Bug 2409": h4. 14.3 Functional Testing of Controllers * Page 221/226: application.rb is now application_controller.rb h4. 16.2 Enumerations and Arrays * Page 273/277: :skip_last_comma has been deprecated. Use :last_word_connector instead. h4. 16.9 Unicode support * Page 283/287: name.chars.reverse is now name.mb_chars.reverse * Page 284/288: is now (twice on this page) h4. 21.2 Routing Requests * Page 424/428: add the following as the first action after starting script/console: ** <code>ActionController::Base.session_store = nil</code> h4. 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 <code>require "config/routes_with_conditions.rb"</code> to the beginning of <code>config/routes.rb</code>. After this is done, you can remove the setup method entirely from <code>RoutingTest</code> as it is unnecessary. h4. 23.11 Adding New Templating Systems * Page 557/560: the render method in RDocTemplate now needs to have two parameters, thus: ** <code>def render(template, local_assigns = {})</code> * Page 558/560: application.rb is now application_controller.rb * Page 559/562: the same change needs to be made to the render function in EvalTemplate too * Page 559/562: remove call to :evaluate_assigns * Page 559/563: the line that starts with <code>template.locals.each</code> now looks as follows: ** <code>local_assigns.each do |key, value|</code> h4. 25.3 Testing E-mail * Page 621/623: replace the following files: ** "test/unit/order_mailer_test.rb": ** "test/fixtures/order_mailer/sent": ** "test/fixtures/order_mailer/confirm": h4. 26.2 Show Me the Code! * Page 628/630: application.rb is now application_controller.rb