Rails 3.0 Release Candidate
Many things have changed since Rails 2.3.x. Few changes (except for those affecting views and mail) affect existing projects beyond the normal cycle of deprecation. Lots affect books, and the way you learn Rails. Examples:
- routes: the API has been completely redesigned. Old routes are deprecated but continue to work, the ones generated by scaffolding for new projects make use of the new API.
- model: validation and traversal have a new API. The old API continues to work and has (yet) to be deprecated; but the new APIs are preferred.
- view: a number of subtle changes that will effect pretty much everybody. All JavaScript is now unobtrusive. Helpers for error messages are no longer present. Escaping of values is now the default.
<%=
instead of<%
is now the correct way to use helpers like form_for. Generated views were changed up a bit, most notably to create a common _form shared between new and edit. - controller: mostly unchanged, just some minor updates, like the ability to pass a notice on a redirect. Of course, the controller is where you do most of your Active Record operations.
- mail: completely redesigned, made to be more like controllers.
- configuration: HTML code in your YAML files will now become escaped. The simplest fix it to rename your keys to end in _html.
- global: RAILS_ROOT, RAILS_ENV, and RAILS_DEFAULT_LOGGER constants are now deprecated. Use Rails.root, Rails.env, and Rails.logger instead.
- commands: all of the non-rake commands changed, whether they were scripts or rails commands before. It is now
rake about
,rails new project
, andrails generate scaffold
. - universal: rails no longer vendors most of its dependencies, instead it delegates management of gems to Bundler.
If you are the type that prefers to learn from a book, there are lots of good Rails books out there. In all, I would say that the most important criteria is picking a book that matches the version of Rails you plan to be working with on.
Agile Web Development with Rails is available for Rails version 2.x and for Rails version 3.x.