Features

Run Internet Explorer 5, 5.5, 6 and 7 natively on Mac OS X Leopard or Tiger

As a web developer, you probably know all about browsers. They suck. Well, some more than others. But, if you develop apps for Windows users, you’ll have to test your app with Internet Explorer. Now, as a good Rails developer, I’m using a Mac. I can test apps with FireFox, Safari and Opera without problems. But Internet Explorer is always a problem. I used Parallels for a while to run an instance of Windows XP to test with IE.

Rails: calculated column caching

Sometimes you’re working on a Rails project and you think: “hey! This should be easy!”. Well, most of the time it is. I’m working on a project that allows people to rate objects (what they really are doesn’t matter at all). I’m using the acts_as_rateable plugin which creates an extra database table containing all ratings. I also have a table with my objects. Using the plugin I’m now able to do the following:

Bash it! - Number of messages in Postfix queue

Got bash? Here’s a nice snippet that will return the number of messages currently in the postfix queue. postqueue -p | tail -n 1 | cut -d' ' -f5 Feel free to post any updates or improvements.

Flash not clearing after a request?

We all know “The Flash” to be a very useful tool in almost every application we write. What does “The Flash” actually do? The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. Well, that’s all nice, but what if you notice that your flash is not cleared, and is shown in one or more subsequent requests as well?

Rails 2.0 New Features

As David Heinemeier Hansson already told us all during his RailsConfEurope 2007 keynote, it’s time to take off the party hats. It’s no longer at time to celebrate all the new stuff we get. It’s time to celebrate what we have already. With this statement DHH ends the revolution of Rails. During the past three years a lot of new and exiting features were added to Rails. However, now the time has come to evolve Rails further.

Content_for, yield and making sure something gets displayed

You may have heard of a very nice Rails technique that used content_for and yield to stuff custom blocks of content into a layout. For example, in a view you could add a block like this: This goes into the sidebar when viewing this action! It doesn’t matter where you put it in the view, because, as you may notice, the content within the content_for block is not shown in the view.

Blueprint 0.5 Rails Plugin released

A few days ago BlueprintCSS 0.5 was released (read the Olav’s posts here). I’ve updated the plugin accordingly. The most important change is the use of 24 (!) instead of 14 columns. Installation and usage of the plugin have not changed. See my original announcement for more information.

BlueprintCSS Rails Generator

This plugin is no longer available. Blueprint nowadays ships with a very good ‘compress’ script that allows you to generate all kinds of nice BluePrint layouts. Having a plugin to just copy some files seems a bit excessive. I think that, if you’re a web developer, you’ve seen the BlueprintCSS framework. BlueprintCSS offers quite a bit of CSS code that allows you to quickly and easily build a grid-based layout, using pure CSS.

Super Simple Authentication Plugin and Generator

I hereby proudly announce my Super Simple Authentication plugin and generator. All right, what does it do? Sometimes you need to protect your actions and controllers, but you don’t want to go about installing restful_authentication or anything like that. Adding a simple password for certain actions would suffice. So, I wrote a little plugin that can generate some code for you that allows you to easily protect your app with a simple password.

Using Iconv to convert UTF-8 to ASCII (on Linux)

There are situations where you want to remove all the UTF-8 goodness from a string (mostly because of legacy systems you’re working with). Now, this is rather easy to do. I’ll give you an example: çéß Should be converted to cess. On my mac, I can simply use the following snippet to convert the string: s = "çéß" s = Iconv.iconv('ascii//translit', 'utf-8', s).to_s # returns "c'ess" s.gsub(/\W/, '') # return "cess" Very nice and all, but when I deploy to my Debian 4.