Radiant: A Rails CMS diamond in the rough



![]()

Inspired by the legendary (amongst Perl programmers anyway!) Perl Cookbook, comes the Ruby Cookbook. It has the equivalent examples from the Perl Cookbook but in Ruby form, of course. The basic sections are mostly complete, although some of the later sections are barely covered yet. Still, if you want to see the basic recipes for dealing with strings, numbers, dates and times, arrays, hashes, file I/O, process management, and so on, it's a cute little resource.

There's been talk about producing something like this in the Rails community, and it seems someone has finally done it.. a Rails Application Visualizer. Simply run a rake task and it produces a graphic showing your models and how they relate to one another. It requires the GraphViz library to run, and is only in its early days. Looks promising though!
This cool Ruby cheat sheet quickly runs you through.. reserved words, syntax rules, escape characters, regular expression characters and formats, file mode strings, special variables, expressions, operations, built in classes, and more. Extremely useful to beginners and advanced Rubyists alike.
Pagination in Rails is good, but it can lack flexibility in many situations. At that point it's time to roll your own. However, Phil Bogle and Laurel Fan came up with a solution they call paginate_by_sql that can solve some of the custom pagination problems. This needs to become a plugin.
You might have noticed this blog has nice, syntax colored code excerpts, as does Code Snippets. Jim Morris looks at how you can pull this off in a few different ways. One quick and easy way is to use syntax.carldr.com, a Web site that converts any Ruby code you paste into the correct syntax colored HTML. Currently I use TextMate and an external script using the syntax gem, but might use that site instead as it's easier!

The forum set up for the Rails Recipes book has a section where readers can write their own Rails recipes. Some of them are pretty good and would have been good contenders for the book. Here are some of them:
A few days ago I learned about Curvy Corners, an incredible JavaScript that lets you put rounded corners on your DIV elements that can do anti-aliasing and handle any size border. It's the best rounded corner script so far.

Rail Mail is a Rails plugin by Scott Fleckenstein that stores copies of any mail that your Rails application sends, and provides an interface to view it.