Browsing all articles from November, 2005

Zebra-striped tables are tables where row colors alternate between a light color and a dark color and can be done both using server-side code (ie. Rails) or client-side code (ie. JavaScript). I posted a question asking for the most convenient way to create zebra-striped tables to the Rails newsgroup some weeks ago and the responses I received were actually quite scathing. I’ve normally done this type of thing using server-side code when working with other programming languages (ASP, PHP, JSP, ColdFusion, etc.), but many people feel that this is an extreme no-no (and aren’t afraid to tell anyone that’ll listen to them), as it muddles up the separation of business logic from presentation.

Anyway, my point is that, regardless of what others think, I want to continue doing this type of design using server-side code and a recent post on the Code Snippets website highlights a Rails helper tag called cycle that makes this very convenient. (The name will be familiar for those that have used the Smarty templating engine for PHP.) The cycle tag is exactly the type of suggestion I was looking for when I posted my initial question to the newsgroup. Before that, I’d been using some nasty combination of if statements and the mod operator to determine the row color and that had completely uglified my code.

This is how you use the cycle helper method:
<tr class="<%= cycle("even", "odd") %>">
... use item ...
</tr>

You can read more about the cycle helper method in the Rails API.

I’ve been meaning to write a more meaningful review of Kodomo 3.5 beta for Windows, but have decided to hold off until I can evaluate a non-beta version. My reason for doing this is because of the fact that it is still in beta, and so, I think it’d be unfair if I critique a product that may still have its functionality changed before the real release.

For example, I have successfully been able to use Kodomo to debug one of my actions. But, because it was so incredibly slow to debug this action through Kodomo, I’ll never do it again. At least, until the speed issue is resolved. And I know that it will be resolved eventually, as it is noted as a problem here in Eric Promislow’s blog.

There are other issues that I’ve encountered that I’m not sure are actually issues with the IDE or just with me as a user of the IDE. For example, I could not get the intellisense to work with my Rails models.

Anyway, when I get my hands on a non-beta version of Kodomo 3.5, I’ll write up a better review. Until then, I may continue to use it to write my Rails apps, but only in the same way that I’d use any other text editor.

ActiveState, a local Vancouver company that I’d only previously known about because of ActivePerl, has just released Kodomo 3.5, an IDE that now supports Ruby. Sadly, Windows and Linux versions are still only in beta, but I’ve signed up to beta test the IDE as I’m eagerly trying to replace Dreamweaver as my Ruby on Rails text editor.

The ActiveState highlights the following Kodomo 3.5 features:

  • Fully-integrated Ruby support
  • Ruby on Rails debugging
  • Code intelligence
  • Cross-platform
  • Highly customizable
  • Supports multiple languages

Of these features, the two I’m most looking forward to using are code intelligence and debugging. My current method for debugging my Rails apps is pretty amateurish, I’ll admit, as usually I’ll just output values to the console window to see what’s going on. I know that Rails has the ability to set breakpoints and debug in a more structured manner, but it all reminds me too much of GCD. I hope that the debugging facilities in Kodomo are more like those contained within VisualStudio.NET, as I’ve come to appreciate the convenience of using a nice GUI for debugging.

Anyway, the 28MB download for my Windows version of Kodomo 3.5 beta is nearly complete, so I’ll end this post here. I hope to have a decently complete review of my opinions of Kodomo online in a few days, so check back then.