Rad Rad Rad Gems and Plugins for rails
Things have come a long way since the first project I developed on rails. Starting out I wanted to keep things simple but now I can’t get enough of the time saving complexity that many great gems and plugins bring!
So here they are, in no particular order at all, a few of the recent tips, tricks, plugins and gems I’ve found to be rad rad rad.
ZenTest
If you’re not testing you’re wasting valuable time. If you’re testing but not using ZenTest you’re still wasting valuable time. In particular, autotest (a part of the ZenTest gem) is a brilliantly simple approach to reducing — as much as I’ve ever seen done — the gap between test and code. You run it and it tests your code whenever and as soon as you change it. Rad rad rad.
Piston
You’ve got plugins or you’re working on the edge and you want that 3rd party code to be up-to-date, right? How annoying is it to re-install that stuff and re-import it into your source tree? Piston acts as an interface between your source tree and the source trees of your 3rd party applications and plugins. piston update and you’re source suddenly has an up-to-date copy, committed and ready to go.
ferret
Hello full text search! This port of the popular, well-designed Java search system Lucene, is an easy way to effectively index the plain text in your models. I find it to be a better fit for most of my projects than MYSQL full text indexing because it exists separately from the database and is explicitly designed for text search.
capistrano
If you’re not using this deployment management tool you’re wasting precious time! It’s simple to setup and easy to use. Let’s see, let me go to my rails root. I’ll enter cap deploy. 1, 2, 3, 4, 5 seconds later and I have the latest version of my source installed, my application servers have been reset, the database migrated, AND I’ve got a complete copy of the last deploy to rollback too if need be. Oh and it resets my backgroundrb (see below) processes plus a bunch of other custom stuff I wrote. Rad Rad Rad.
backgroundrb
In the Java world this would be called Quartz. In the ruby world its just as indispensable. Perhaps not when you’re starting out, but pretty early on you can be sure you’ll need to run, on an automated basis, various scripts. I use it to manage the sending of emails so that I don’t tie up my mongrel application processes. I also use it to do database and session cleanup.
RedHill Consulting Plugins, et al
These guys offer a series of plugins so simple and useful they feel like they ought to have been a part of rails itself. foreign_key_migrations is a plugin that automagically creates indexes in your database based on your database schema. A users table which references a article_id will automatically get an foreign key index to the articles table. Rad rad rad. (This can create some hassle with your test fixtures though, since you won’t be able to insert data with bad references.)
Exception Notification
This plugin is a life saver! And pretty annoying too! It makes it easy to get an email detailing what happened when something goes wrong with your rails app.
Routing Navigator
This handy plugin can really help with the transition from your old rails app to your new RESTful application by displaying information about all the routes and named route methods being generated by your routes.rb
Simply Helpful
Written by DHH himself, this set of helpers and methods simplifies a lot of common tasks. polymorphic_url(object) generates the correct URL for any model which has coverage in your routes.rb. dom_id(object) will create a class + id based identifier which you can reference in your RJS scripts and HTML to ensure everything gets wired up correctly. Handy!
Paginating Find
I’ve just started using this one but it looks great. Instead of using this weird extra pagination method, paginating find adds a few simple options to the built in find command to more efficiently allow you to select out pages of models.
File Column
Though not updated in a while, this plugin makes it super easy to add files to model objects. In particular, it handles images very well and has great integration with rmagick to automatically do things like image resizing and version management.
Validates Url
A little something I wrote, this guy does simple validation on model fields to check that they have a certain protocol and are correctly formed server/path strings.
My name is Peter T. Brown. I am a partner at Waggle Laboratories, LLC which develops lightweight social applications for business and pleasure. Our latest and greatest is RealityAllStarz where you earn points for doing unusual and interesting things!
February 22nd, 2007 at 11:36 pm
Awesome list! I thought I’d add one more that we have started using recently, acts_as_state_machine:
http://lunchroom.lunchboxsoftware.com/2006/1/21/acts-as-state-machine
the name really says it all. A great way to keep track of the state of an object – user permissions, message status, etc.