Community Highlights

Posted by Gregg Pollack October 22, 2009 @ 02:43 PM

I’m always impressed by the continuous flow of innovation from the Rails community. Below are just a few of the highlights from the past month. These stories all came from the Ruby5 Podcast, which covers all the news from the Ruby and Rails community twice weekly.

Authentication

The talented Brazilian guys over at Plataformatec released the Devise gem this week, a new authentication option for your Rails app. Devise is a Rails Engine which sits on top of Warden, a Rack authentication framework. This makes Devise a little more flexible then other Rails authentication libraries, and is definitely worth a look.

On the otherhand if your application needs something more simple, check out Terry Heath’s OpenID Rails Engine. It should take you about 10 minutes to have an authentication system up and running, and you won’t have to worry about storing your users’ passwords.

Helpful Libraries

Thanks to Twitter’s new Streaming API we no longer have to poll every 5 seconds to discover new tweets. To start using it today check out the TweetStream Gem by Intridea.

With Rails 2.3 we gained the ability to utilize Rack Middleware in our Rails apps. If you don’t know what Rack middleware is yet go watch this screencast. Also, if you’d like some idea on how to use it, check out the CodeRack Middleware Contest, a competition to develop more useful and top quality Rack middleware.

A few weeks ago I heard about a javascript library called Validatious, which provides unobtrusive javascript for doing client side form validations. I know what you’re thinking though, “if I do both client side and server side validations I’ll have code which duplicates validation logic, and that makes me want to hurl.” Don’t hurl quite yet, first check out Jonas Grimfelt’s Validatious on Rails plugin which will auto-generate client-side validations using your existing model validations.

Optimization & Performance

If your Rails app needs to be able to handle many users uploading files at the same time (think Flickr), then you may want to look at ModPorter, an Apache module and Rails plugin created by Pratik Naik and Michael Koziarski. ModPorter parses incoming multipart requests storing the file to disk before it reaches your Rails app, so your Rails processes don’t get held up. We hear there is also support for nginx through a 3rd party module.

When you’re dealing with a database abstraction like ActiveRecord, it’s very important to ensure you’re writing optimal database queries. If you’re worried that your app may be doing more queries then it should or isn’t using eager loading properly, you may want to checkout the Bullet plugin by Richard Huang. Bullet can actually give you growl notifications when you’re missing an :include or should be using a counter cache.

Do you have mongrels that are consuming more then 150 Megs of RAM and you don’t know why? Do you suspect that it might be Ruby leaking all over the place? Then you’d probably be wrong, and Sudara Williams will tell you That’s not a Memory Leak, It’s Bloat. It’s more likely that you’re instantiating thousands of ActiveRecord objects, and Sudara gives you a few suggestions on how to find them.

Cleaning up code

The presenter pattern is very useful for encapsulating code that may be making your controller look fat, code that may not belong in your model. Dmyto Shteflyuk wrote up a great introduction to using presenters that’s worth a read if you’re not using them already.

Sending complex data-sets between Ruby and Javascript isn’t always easy. Don’t you wish there was a way to take that Ruby hash and just have it automatically transform into a javascript Map? If yes, then you may want to look at jsvars by Erick Schmitt, that’s what it does.

Deployment

You may already know about Chef (the system integration framework) but did you know that you can also deploy your Ruby app from chef using chef-deploy? Ezra Zygmuntovich created this gem which allows you to run your chef recipes and then if they pass (and only if they pass) deploy your code in a capistrano like fashion.

If you’re deploying a Rails cluster to Amazon EC2, then another solution aside from using Chef is a gem called rubber by Matthew Conway. Rubber keeps deployment a first class citizen, storing all your server configuration files inside your Rails app where they can quickly be tweaked under version control. It comes with many deployment best practices out of the box and can scale up or down at a moments notice.

Media

Have you ever wanted to run a Rails tutorial in your city, but you’re discouraged by the thought of writing all the course material? Then you need to checkout the Rails Bridge Open Workshop project where they have all the course material you’re going to need, for free! You have no excuse not to spread the word of Rails anymore.

Lastly, if you’re looking for additional Rails screencasts, you may want to checkout Teach Me To Code, and if you’re looking for additional Rails reading, then check out the past few issues of the Rails Magazine by Olimpiu Metiu.

Thanks for reading, and if you have any Ruby or Rails news you’d like to spread the word about, please send it into the Ruby5 podcast by emailing ruby5@envylabs.com.

Image Credit: Blue Sky on Rails by ecstaticist, Analog Solutions 606 Mod by Formication, Rainbow by One Good Bumblebee. Orange County Security by henning, Broom by fatman, remember by tochis, Darwin Was Right About Media Players! by Neeku.

Posted in Activism | 14 comments

Comments

  1. Kyle Slattery on 22 Oct 15:43:

    Kind of bizarre to have the Berlin Holocaust Memorial be the graphic under “deployment”...

  2. Eric Berry on 22 Oct 15:45:

    Excellent overview of gems and resources. Thanks for creating this Gregg!

  3. Tom on 22 Oct 16:46:

    super, great additions as always!!!

  4. Tom on 22 Oct 16:47:

    Would love to see deep integration with Dojo in Rails… :-) Seriously, why donĀ“t take that step? Dojo is absolutely feature-complete!

  5. @rodrigo3n on 22 Oct 17:38:

    Really amazing! In addition to the Railslab’s Rack Screencast, I found these three others from @remitaylor. Guys, you should watch http://bit.ly/1Kibs3 http://bit.ly/17idHh http://bit.ly/1Kibs3

  6. Greg on 22 Oct 18:38:

    Yeah I’d get rid of the Holocaust Memorial picture, I’m guessing you didn’t realize that’s what it was.

  7. Gregg Pollack on 22 Oct 18:56:

    Got rid of the picture, although I thought it was quite artistic and symbolized the scaling of many monolithic servers well.

    Not a big deal.

  8. BrianTheCoder on 23 Oct 01:24:

    The nginx upload module does the same thing as mod porter.

  9. chris on 23 Oct 07:39:

    I’ve to agree w/ Kyle… What a sick joke.

  10. Jo on 23 Oct 13:01:

    Life as a comedian is tough. Fine lines…

  11. andhapp on 24 Oct 16:19:

    I did not read the author’s name and was wondering this looks suspiciously similar to ruby5 podcast. Anyways, read Gregg’s name in the comments and thanks again for a nice roundup from the ruby/rails world.

  12. spelling_bee on 31 Oct 16:47:

    Ezra’s last name is Zygmuntowicz, right, with a “z” not an “h”? (you spelled it as Zygmuntovich)

  13. Mike on 02 Nov 15:06:

    Thank you for the info. I choose not to nit pick. I am thankful for you taking the time to contribute this.

  14. shaiguitar on 03 Nov 14:22:

    Sudara’s article++