Acts_as_conference Wrap Up

Ruby on Rails developers in Orlando had a treat this past weekend with Acts_as_conference taking place right in our own backyard. Aside from Bar Camp Orlando, we’ve been light on the large-scale, on the cheap conferences. Acts_as_conference was a well deserved $100, for which attendees got 2 days of presentations, snacks, breakfast and a rare opportunity to see the Orlando Ruby community gathered together with notable names from around the Ruby world. Still being a newcomer to the Rails world, most the names might not have stood out as much before, but it was great hearing them in action.

Day 1: Friday
The first half of Friday started with a pair of charity sessions on Merb and Rubinus — both projects I hadn’t even looked into prior to the talks. For those as clueless as me — Merb is another web application framework for Ruby that is strikingly fast (compared to Rails). It has no ORM built into it, but one can be used as needed of course. One thing that stood out to me was how controller actions were handled. Take a register action for a user in most frameworks; it would be a controller that doesn’t take anything in, but grabs all data it needs for the params hash. Merb (from what I understand) can work differently. Your controller itself would actually take in the user; and it would be grabbed from the form. There is also the idea of a Parts, which can be called from Controllers to delegate repetitive work. In Rails it seems like The Rails Way is to move as much as possible into the models to ease the controllers, but Merb can move some of this into Parts.

The last talk of the day was a very simple one. Well, it wasn’t a simple talk, but it was on Simplicity in design. Dan Benjamin gave a great talk that wandered from super tuesday to the super bowl to Einstein. We shouldn’t make things hard for the user, or they won’t love our software. If they don’t love our software they won’t use it and talk about it. If we make the user our number one priority and concentrate on giving them what they need to accomplish a very small set of goals extremely well, people will remember and spread the word. Dan went on to show how this approach worked beautifully with Cork’d which, dispite not advertising, was able to ramp up to 5,000 users in the first month alone.

Make everything as simple as possible, but not simpler. – Albert Einstein

Day 2: Saturday
After a free breakfast and a brief entertaining advertising spiel by the sponsors Engine Yard and Sun, the presentations started with a much anticipated one on JRuby. Brian is working on our first JRuby on Rails site at work, which could lead to bigger and more fun projects along the way. The JRuby benchmarks were very impressive, and on par with Ruby 1.9. Development gets a speed boast by being able to develop on regular ruby as well before moving to war (warble) for deployment.

Day 2 continued on with Bryan Liles on TDD/Testing, which we all agreed was one of the highlights of the con. It was a funny, witty presentation, that kept everyone entertained while still educating. The talk wasn’t about a specific testing framework or style, but more about brushing away misconceptions about testing and the differences between BDD and TDD (namely that they’re the same thing). The emphesis was on writing good tests, repeating this behavior until it becomes second nature and being sure to do it before you code. Sounds like a simple enough route towards testing utopia.

Obie Fernandez ended the conference with an extended analogy about our craft. There are better write ups about this presentation, but I’ll agree it was inspiring. Both the keynotes shared a very similar tone and emotional impact, leading me to a day of programming afterwards.

For more write ups, check out Roop Says, or Max’s or Marios writeup. Very fun local conference. Look forward to attending again next year!

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?