Rails 1.2: Release Candidate 2

This is it. We’re a mere two shakes of a lamb’s tail from releasing the final version of Rails 1.2. But before we light the fireworks and pop the champagne, we’ll just do one itsy, bitsy, tiny test run. Like wearing protection glasses in downtown Copenhagen on New Year’s. You know, just for precautions.

So please do give it a good run. We’re looking for STOP THE BOAT and HOLD THE PRESSES kind of issues for this one. Nothing else will stop it (but please do report every thing you find any way).

For a reminder on how to install and what’s new, see the release notes for Release Candidate 1. We also did a series of highlights for Active Record, Action Pack, and Active Support. Read those and hold your breath in anticipation. Unless a surge of heinous issues appear, we’re expecting the final version to land some times next week.

Yay, hurray!

Using custom mime types

So, you’ve started using Rails’ new mime type support with responds_to, but you were wondering how to add your own custom types? Luckily, Geoffrey Grosenbach (aka topfunky) is there to show you the way. His example involves registering an extension for .png, and generating a custom icon for an order in his shopping cart with some RMagick-fu. His example looks something like this:

Mime::Type.register "image/png", :png

# then in your controller action
def show
  respond_to do |format|
    format.html { }
    format.png { }
  end
end

Mime::Type.register will add the image/png mime type to the collection of mime types, bind it to the .png extension. It also creates a special Mime::Type instance at Mime::PNG. Check out the great post and the comments for more tips on caching and RMagick.

Note: After some investigation, I’ve found that using Geoff’s :format hack is not required on Rails 1.2 if you make the request with the :format parameter. Using routes like formatted_post_path(@post, :xml) will give you a path like “/posts/1.xml”. Accessing that will write public/posts/1.xml, regardless of what the page_cache_extension is.

A brief introduction to Active Resource

Rick Olson is getting jiggy with Active Resource these days and decided to spread the love with a brief introduction to the newest member of the Rails framework family. He takes you through how to use ARes as a client for the Beast forum in a few simple steps. Get your REST face on and enjoy.

Working with Rails? Tell the world

Working With Rails is an attempt to index all the developers around the world working with Rails. It offers a few ways to browse the index and while the authority and popularity lists are perhaps a tad silly, I love looking at the country list. 3 programmers in Peru, 1 in Kazakhstan, and 3 in Uzbekistan. How cool is that?

Trying to break free from .NET?

Luckymonk escaped their .NET entanglement and found Ruby on Rails, but they still have to live in a Windows world. Now they’re putting on a workshop teaching you how to do the same. It’s in Chicago and it’s almost sold out.

Usually we don’t mention workshops any more (there are so many), but I thought it would be nice to shine some light on one of the lesser published transitions. The one from .NET to Ruby on Rails. We got plenty of stories of how PHP and Java folks are jumping ship, so its great to hear how it’s happening from the Microsoft camp too.

Amazon goes Ruby on Rails

Never thought you’d hear that, eh? But that’s exactly what unspun.amazon.com is. A Rails application sitting on the Amazon.com domain. Adam Selipsky from Amazon Web Services introduces the site with this:

UnSpun helps you to find and create ranked lists by gathering votes from workers on Amazon Mechanical Turk and from the UnSpun community. We show the popular opinion, with no “spin” (hence the name) — along with links to websites with more information about the particular items on the list. If you don’t see the list you are looking for, simply create it and rankings will start populating within a few minutes. 2,294 ranked lists are already on UnSpun, holding 640,107 items, with more coming in all the time.

Congratulations to the AWS team at Amazon!

Coming shortly, we’ll have a bunch of other announcements for high-profile companies going Ruby on Rails for various new projects. Exciting times.