March 2008
5 posts
5 tags
extra action
The following code samples, taken from a controller, demonstrate different ways of creating a Referral with or without a Team. A Referral represents one user inviting another eventual user to the site and optionally to their Team. Whether this is the best way to model this doesn’t matter, right now, I just want to take a look at a couple different code samples. if session[:team_id].blank? ...
Mar 28th
8 tags
For attaching files, use Paperclip
Last Update: For archival reasons, I’m removing direct links to releases, etc. from here. All the info you need is at the official paperclip project page. For some reason, file attachment is annoying. I don’t know why, and I know a lot of people have attempted to solve the problem in the past, myself included. Yet it still is. Having gotten fed up with gotchas and design decisions that we...
Mar 18th
2 notes
What coder type are you?
The Warrior: Through the days in the life of a warrior, you strive to be explicit. Resorting to partials is only a sign of weakness. Thousands of lines of duplicated code will triumph over that petty conditional logic. Everything you write can be understood by all; you fight on an open battle field, and expect your fellow coders will do the same. Never will you add a plugin you don’t...
Mar 14th
2 tags
Fluid Scripts for Campfire
Growl when someone says your name, and better behavior in Fluid At thoughtbot we’re a distributed team: 7 in Boston, 3 in New York City, 1 in Chicago, another in San Francisco, and myself in Philadelphia – we use Campfire constantly for team communication throughout the day. Almost all of us used Pyro to access Campfire, but after upgrading to Leopard things started going downhill – so we...
Mar 6th
Shoulda 4.0.1 - the lean and mean release
Shoulda is a great tool for cleaning up your tests, but there was always some dirt under the hood that was keeping me up at night. I don’t want to just move complexity around – I want to remove it entirely. A recent change in edge rails forced me to get off my butt and do that. So everyone give a warm hello to the latest Shoulda gem. It now uses a Context class in the backend,...
Mar 3rd