What's Now in Rails: Libraries

- -

What Gems/Jimmies are you finding indispensable these days?

@peter_braswell

Dr. Nic’s Textmate Footnotes

Famous Railsist “Dr. Nic” has a great footnotes plugin which you can get a taste for from the README on that page. It’s a must install if you choose TextMate as your editor.

Named scopes

Your Rails developer badge will shortly be revoked if you do not learn and use named scopes liberally. The way that they can be named, composed, and reused in multiple contexts can result in some extremely powerful and expressive code, that remains readable and even has some excellent performance characteristics.

Learn more at RailsCasts and Ryan’s blog

will_paginate

Out of the box Rails pagination is a thing of the past, I think. will_paginate is as much of a drop in as it gets, and it’s flexible in all the right ways. It’s also kept very much up to date and remains in active development.

rSpec and cucumber

While I’ve decided that my overall thoughts on testing are probably going to end up being a talk, I can provide my favorites here. rSpec provides a nicer syntax than test/unit for my tastes. Further, the capabilities that come with the stories functionality provided by cucumber (detailed by Peepcode) have been a revelation on my primary project.

fixture_replacement2

I personally have come to dislike fixtures strongly. There are definitely techniques that can be used to reduce their downsides, like dataset (previously known as scenarios), but I favor leaving them behind altogether. Once you’ve made that decision, you have options still, like factory-girl (plenty of good alternatives mentioned at that link, as well). dataset even mentions that it can play along with other alternatives

For my part, I’m satisfied with fixture_replacement which is in a second version. It doesn’t look like it’s active, but I enjoy the flexibility that comes with being able to ask easily for objects that have or have not been persisted and they have the exact same set-up. I hope to provide more detail there later.

These are the only tips and techniques that I’d bring onto each project. For anything else, I’d be checking out the diverse Rails ecosystem out there! It’s getting more pleasant by the week.