Rails Plugins Recommendations

One of the niceties about working with Rails is how most plugins just work. Since plugins are tied to the framework, and just about everyone that works for web development uses Ruby, it gives a huge base of helpers and code to get you started unlike anything I’ve seen — outside of Java. ColdFusion has a very strong community, with many projects at RIAForge and many more added every week, but what makes Rails stand out is the common ground under which they’re implemented and integrated. All ColdFusion frameworks have their own ways of creating helpers/plugins/services/whatever like this, but there’s no one “ColdFusion Way”. There are a few Rails plugins that evem me, a Rails novice, have been able to implement and reap the benefits in a relatively small time frame. What plugins am I using so far?

ActionMailer TLS – Have you ever gotten annoyed needing to install a local email server to do your testing? With this plugin you can use Gmail for all your outgoing mail. There’s a 500 email limit or so, but for testing purposes it makes it easy to get setup — especially if you’re alternating between multiple computers. Another option would be to set this up to use Dreamhost or something of course. The advantage of using Google though is it’ll save all your outgoing mail as well, so you’ll be able to see exactly what was sent during testing without digging into logs.

GeoKit - Google Maps plugin for Rails. This one has a lot to it. You can create entire maps without knowing the Google Maps API, with overlays of map popups and all that, run calculations on distance between points and geocode addresses (physical or IP) into latitude/longitude very easily. It answers questions like “Get all restaurants within 15 miles of the logged in user” with simple code like Restaurant.find(:all, :o rigin => @user_address, :within => 15). Imagine that returning a query with a “distance” column which has the distance in miles between the two.

Acts As Rateable – If you have locations you’ll need to rate them right? Chances are there’s other things on your site that need rating as well, so this cleans up some of the code for this. It’s something that could be done without a plugin, sure, but adding “acts_as_rateable” to a model is all you need to get going.

ResourceController – I only recently found this out, but it’s cleared up the repetitive code in some of my controllers. The idea is that it’ll setup all the boilerplate code in RESTful controllers, making it that much easier to get started. If you have nested resources in particular this cleans up the code for it quite a bit by providing helper functions for where in the execution chain of nested controllers the current call is at.

Restful Authentication – This seems to have to replaced ActsAsAuthenticated as the most used authentication plugin. Today I was going though a Restful tutorial to expand on my current restful authentication setup. In not too long I had a nice roll based authentication system with email driven activation, reset and change password sections. Not bad for an afternoon.

Will_Paginate – Easy Pagination! What makes this pagination plugin great is the ease of use. If you’re returning an array of activerecord objects, like with Model.find(:all), then you won’t have to change anything in your view to keep things working. Will Paginate also returns that same array — well sort of. The array that it returns can be looped over in the same way, but is also contains the pagination data, such as current page and results per page. Add this into a will_paginate @games which generates those all too familiar numbered pages and you have pagination. The only thing that needs to be done is changing the find(:all) call to use the new paginate method.

Any common Rails Plugins you can recommend?


 
 
 

9 Responses to “Rails Plugins Recommendations”

  1. You ever find an editor you like? I finally purchased “e” (heavily influenced by TextMate, even supports TextMate bundles) and have been really happy with it.

    http://www.e-texteditor.com/

  2. I had not heard of the ActionMailer TLS plugin before. Thanks for the great links!

    I suppose I could also mention that my web app uses YM4R instead of GeoKit. GeoKit does look interesting though.

  3. You reference a “Restful tutorial” above, but there is no link. Which one are you referring to as I need to ge up to speed with rest.

  4. @Bill
    I should give YM4R a little more attention. Last I saw it looked powerful, but not as well documented as Geokit.

    @Karl
    Thanks for the heads up! It’s fixed now. I ended up making it through that tutorial and everything is working well, so I can vouch for it being helpful and effective.

  5. [...] Recommended plugins [...]

  6. i got a method not found error,like sean, too.

    i wonder if it is a confliction with will_pagination plugin.

    i have also try the acts_as_voteable, the same error occur.

    any suggestion?

  7. the trace info:
    undefined local variable or method `acts_as_voteable’ for #

    D:/code/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in `method_missing_without_paginate’
    vendor/plugins/will_paginate/lib/will_paginate/finder.rb:93:in `method_missing’
    app/models/location.rb:5
    app/controllers/locations_controller.rb:18:in `show’

  8. @Tedd
    Hmm, you’re sure it’s acts_as_voteable rather than acts_as_rateable? Just double checking there.

    I’d try posting a comment to the author on that one. Nothing comes to mind to solve it off the top of my head, but I might look into that plugin sometime. Thanks for the heads up about it.

  9. @Joe Zack
    Sorry about that, have it set to moderate all comments with a link in them and didn’t realize you weren’t spamming me. :p

    But glad you decided on E! I’m using it on both my PCs at home and absolutely love it. The Railscasts theme is just the kind of coloring I love, and since E works with Textmate themes it installs easily enough.

    I also like how easily E ties into TortoiseSVN. You can run all controls right from the textmate project window.