10 must-have Rails plugins

I was talking to Tim the other day about auditing Rails projects, and how we see a lot of Rails projects that reinvent the wheel instead of using plugins. The obvious follow-up question, of course, is "What plugins (or gems) should we be using?" Below I list ten plugins that we use regularly, and a brief reason why you might want to, too.

  • fixture_replacement2: fixtures are difficult to maintain. There is no "one size fits all solution," but we have found this to be a big help.
  • tarantula: A single test can find a lot of bugs, if that single test visits every link in your app, tries to submit bad data, and polices your output HTML.
  • test_spec_on_rails: specs are better than tests.
  • permalink_fu: meaningful URLs for your objects.
  • safe_erb: don't trust external data!
  • unit_record: get the database out of your unit tests. 1000s of tests can run in seconds.
  • restful_authentication: clean, simple authn.
  • multi-rails: test your code against multiple versions of Rails in a single rake task.
  • attachment_fu: most apps need attachments eventually.
  • exception_notification: find out by email when things go wrong.

Many of these plugins have alternatives (e.g., you could use rspec instead of test_spec, or nulldb instead of unit_record). Regardless of which plugin you pick, make sure you think about the features provided by the plugins above, and don't reinvent the wheel.

Notice that most of these plugins are already in git, so forking them is easy. If you see something that needs improvement, jump in and do it! While reinventing the wheel is bad, improving the wheel is most welcome.

[6/18/2008: updated to include github url for fixture_replacement]