
Today on the program, I’m going to discuss a few Rails development tools that I’ve had the pleasure of using recently.
Footnotes
If you’re like me, you like starting paragraphs with the phrase “if you’re like me”. You also used to use the TextMate footnotes plugin, then got frustrated with it in the Rails 2.0 timeframe when it didn’t get updated for a while. Every now and then you’d sigh, and remember the days when you could click on a stack trace in your browser and open the associated file.
Sigh no more, because the plugin is back, it’s now called rails-footnotes, and has been placed on GitHub by Dr Nic. It’s also got, I think, a few new tricks up its sleeve. In addition to the linking of stack traces, every page in developer mode gets the following at the bottom.
![]()
The top line is links to the Rails source files associated with the page. (If there’s more than one file you see a list of all files). The bottom row shows you the session/cookie/param values associated with the request. Not only that, but you get to see all the before and after controller filters, the route used. All SQL queries with a stacktrace for where the query was called and a link to show the Explain log for the call. Plus the log entries for that request. Plus you get a special div that you can add to via JavaScript to log your own messages.
In other words, it’s a lot of information. You really want to be using this.
Ruby AMP
Moving a little bit further into the TextMate realm, the very useful Ruby AMP bundle provides a whole bunch of useful commands. The one I use most is “Complete word from all open documents”, which is just like the completion you get from pressing Escape, except that it searches all open documents. If you are in a test file, and trying to remember the name of a method in the model file, this is very useful.
The one I use second most is “Grep in Project”, which is about a zillion times faster than TextMate’s native find. There are also more specialized grep options, like grep for method, which searches for a method with a given name, and includes attribute accessors and Rails association declarations.
The bundle also has a lot of debug options, plus commands to tail the developer log, or show a list of all open windows, and on and on. This bundle had a noticeable affect on my coding.
Hoptoad
We’ve been playing around with various ways to do exception notification on our staging and deployed projects but nothing had quite hit the mark. Just in the last week or so, we’ve started using Hoptoad, a new free service from thoughtbot. What you do is register a project with Hoptoad. You are given instructions to install a plugin, add an initializer file, and include the plugin in your ApplicationController. Then all uncaught exceptions will get sent to Hoptoad, and you’ll get an email notification. The Hoptoad listing will have a backtrace and a metric boatload of background context information.
But here’s the cool part — if the same error is triggered a gazillion times, you only get one email — Hoptoad aggregates the similar errors into a single record (you can browse the individual contexts). You can then mark all the similar errors as resolved at once. Hoptoad also exposes an RSS feed for each project. It’s useful, cool, and free.

Footnotes looks really neat. Unfortunately a quick Google search didn’t turn up anything similar for PHP, if anyone knows of any I would love to know.