Blog posts
Collected posts from the various blogs I’ve contributed to over since 2002.
Collected posts from the various blogs I’ve contributed to over since 2002.
Stage 2 of fixing up theme_support for Rails 2.3 was making sure that ActionMailer picked up themed templates (for stage 1 information see here). That’s something I’d not quite cracked in the 2.2 version, so starting afresh with 2.3 forced me to spend the time to look through the full render path and figure out what was going on. ActionMailer is a little more complicated than ActionView in that there are multiple routes of entry (ways of sending emails) and each email can have multiple templates associated with it to allow for multipart email. But at the core of it all is the ActionMailer::Base#create! method. This executes the specific method that populates the mailer variables (ie. the code you actually write in your mailers) and then uses Dir.glob to look for appropriate templates for this email: ...
A couple of months back, I realised that two of my projects ( Generous and Catapult) could do with the help of the theme_support Rails plugin. Discovering that it didn’t play nicely with Rails 2.1, I created a fork on github and hacked at the _pick_template method to get it to do what I wanted. It turned out a few people were interested in having the plugin work with Rails 2.1, some of whom used more of the plugin’s featured than I need, and a few further forks emerged. I’ve been meaning to work through them and merge together the best bits, but the impending release of Rails 2.3 stopped me in my tracks. ...
I like to always have at least one project on the go that works as a testbed for a variety of new Rails techniques, tools and releases. For a long time that project was Grand Rapids WiFi, a site that lapsed into some neglect after I moved (a long way) away from the town it focussed on, but which I still officially maintain. It was where I first tried Rails 1.1 and 1.2, where I got to grips with various geo tools, and where I first generated RDF and Atom from a Rails app. ...
For quite a while I used del.icio.us to post summaries of interesting links here on an almost daily basis. After a while I got a little tired of the aesthetics of that: the clunky titles, the way it inserted tags, the fact that sometimes there was just one link and sometimes many. And I realised that for the quick/transient linking twitter works better. So for now I’m going to try and post a digest every week or so, selecting the highlights. If you really want regular updates on what I’m keeping from what I’m reading, you can always follow me on delicious. ...
For a few years, the Oscars got quite a lot of my attention. It’s not that I often agreed with the Academy’s choice, but I did try and make sure I’d seen as many as possible of the nominated films, and was eager to engage in commentary about the rights and wrongs of the Academy’s choices. This year, I’ve found myself almost entirely disinterested. But I did read Stephanie Zecharek’s overview—" Let’s Beat Up On The Oscars"—and enjoyed a couple of sections enough to want to share. ...
A few months back—while we were discussing the number of talking objects appearing on twitter— Jenny pointed out to me that all Heathrow airport arrivals and departures data is online. That set my mind racing, as if you know all the flights leaving that currently controversial airport, there are all manner of things you could begin to do. Working out miles travelled and carbon emitted, spotting delays, and so on. But at the time it all came down to a quick note in Things to some day set aside time to explore. ...
Thoughtbot have released a suite of plugins over the past few months that are enlivening the fields of Ruby on Rails file attachments ( paperclip) and authentication ( clearance), long dominated by Rick Olson’s attachment_fu and restful_authentication. You can see some previous posts about attachment_fu here and here. I’ve been playing with paperclip on a couple of projects, including one which was previously using attachment_fu. That necessitated some work migrating the previous attachments. Opinions are divided on whether data should be transformed in migrations or in separate libraries, and I’d rather remain agnostic on that, but I whipped together some code that can be used either in migrations or an external library to make the transfer. ...
I’ve been working on a wordpress plugin to make it easy to set a banner image for any blog entry outside the post content. The current approach is flawed as it requires hacking at the form tag for the post edit page to allow file uploads, but while I look around for a better way to do that without sacrificing the simplicity of the UI, I wanted to share some digging I did to figure out how to handle file uploads with wordpress. All this data is available in the documentation, but it took quite a bit of looking to find it and there aren’t enough examples kicking around. ...
I’m currently building a site where users will enter details of books and music they’re listening to and we want to provide lists of that on their profile and also find ways of matching users based on those choices. We’re looking at a number of ways of doing that, including matching based on genre, and in order to achieve that I needed a way to identify the genres for their listed books and music. ...
UPDATE: The camera has now been sold Having recently upgraded to the wonderful Canon EOS 50D I’m looking for a new home for my old 400D (actually the US version: the Digital Rebel XTi). I’ve taken about 15,000 photos with it and it was a great introduction to the world of digital SLRs. Despite all that use, it’s in really good shape and will come complete with a 2GB memory card, a spare (non-Canon, but perfectly fine) battery, strap, 18-55mm kit lens, and US and UK chargers, all in the original box. ...