March 2008
3 posts
5 tags
New Gem: Avatar
I released Avatar version 0.0.3 today. This gem offers avatar support for a variety of sources. It’s not Rails-specific, but to use it in a Rails app, do something like the following. In app/helpers/people_helper.rb: class PeopleHelper include Avatar::View::ActionViewSupport def default_avatar_url(size) req = controller.request ...
Mar 27th
9 tags
The Final Word on Rails Association Extensions
There has been a great deal of debate on how to extend Rails Associations. Ryan discusses the “block” method: class Organization < ActiveRecord::Base has_many :people do def find_active find(:all, :conditions => ["active = ?", true]) end end end This is identical to the “extend” method; in fact Rails converts a “block” into an...
Mar 11th
5 tags
Shelves: Rack Extensions
I think Christian’s Rack is fantastic. It’s such a good idea, in fact, that Ab5tract and I are starting a GitHub projct called Shelves for Rack extensions. Our mission is to do request and response support for all the non-HTTP types of interaction that a website needs to do these days. We envision SMS, Email, and Twitter queries, and maybe even Port Knocking. Shelves will be modular,...
Mar 11th