Rails 1.2 Features

September 5th, 2006

Bob Silva has posted a list of features coming to Rails 1.2 which may hvae a release candidate out in the next few weeks. A few of my favorite that Bob listed are below:

  • Access nested attributes in RJS templates. Now you can use syntax like this: page[:foo][:style][:color] which will generate javascript like: $('foo').style.color
  • Now you can access the locals hash directly. In your partials, you can check if a local varialbe was passed in by doing: if locals[:local_var] then ...
  • The default for foreign_keys will be the association name, rather than the class name. So if you specify a :class_name with no :foreign_key on your belongs_to associations, it will throw a Deprecation warning.
  • In the testing department, assert_tag has been deprecated in favor of the new assert_select family of assertions.

Check out Bob’s article for the rest of the list. Also, if you are interested in the prototype updates, you can read Justin Palmer’s first and second entries detailing the changes. They look pretty interesting.

Leave a Reply


(textile enabled)