Microsoft Vista Software | Microsoft Vista Books | Linux Books | Ubuntu Books | Ruby On Rails Books

Tuesday, March 28, 2006

Ruby On Rails 1.1 Has Been Released

The biggest upgrade in Rails history has finally arrived. Rails 1.1 boasts more than 500 fixes, tweaks, and features from more than 100 contributors. Most of the updates just make everyday life a little smoother, a little rounder, and a little more joyful.



From the Ruby On Rails Site:


But of course we also have an impressive line of blockbuster features that will make you an even happier programmer. Especially if you’re into Ajax, web services, and strong domain models — and who isn’t these funky days?

The star of our one-one show is RJS: JavaScript written in Ruby. It’s the perfect antidote for your JavaScript blues. The way to get all Ajaxified without leaving the comfort of your beloved Ruby. It’s the brainchild of JavaScript and Ruby mastermind Sam Stephenson and an ode to the dynamic nature of Ruby.

Here goes a few sample rjs calls:

# First buy appears the cart, subsequent buys highlight it
page[:cart].visual_effect(@cart.size == 1 ? :appear : :highlight)

# Replace the cart with a refresh rendering of the cart partial
page[:cart].replace_html :partial => "cart"

# Highlight all the DOM elements of class "product"
page.select(".product").each do |element|
element.visual_effect :highlight
end

# Call the custom JavaScript class/method AddressBook.cancel()
page.address_book.cancel

# 4 seconds after rendering, set the font-style of all company
# spans inside tds to normal
page.delay(4) do
page.select("td span.company").each do |column|
column.set_style :fontStyle => "normal"
end
end
And that’s just a tiny taste of what RJS is capable of. It takes the Ajax on Rails experience far above and beyond the great support we already had. Bringing us even closer to the goal of “as easy as not to”. Read more about RJS in the docs or in Cody Fauser’s tutorial about element and collection proxies and his introduction to RJS (it shouldn’t surprise you that Cody is writing about book about RJS for O’Reilly).


Upgrading from 1.0

So with such a massive update, upgrading is going to be hell, right? Wrong! We’ve gone to painstaking lengths to ensure that upgrading from 1.0 will be as easy as pie. Here goes the steps:

Update to Rails 1.1:
gem install rails --include-dependencies
Update JavaScripts for RJS:
rake rails:update
That’s pretty much it! If you’re seeing any nastiness after upgrading, it’s most likely due to a plugin that’s incompatible with 1.1. See if the author hasn’t updated it and otherwise force him to do so.

If you’re on Ruby 1.8.2 with Windows, though, you’ll want to upgrade to the 1.8.4 (or the script/console will fail). And even if you’re on another platform, it’s a good idea to upgrade to Ruby 1.8.4. We still support 1.8.2, but might not in the next major release. So may as well get the upgrading with over with now.


Some Ruby On Rails books:
Agile Web Development with Rails
Ruby On Rails
Ruby For Rails
Beginning Ruby On Rails
Ruby In A Nutshell

Go to the the Ruby On Rails site

No comments: