@phiggins Pointed me to this which is quite similar (specifically the 'Tidying Up the Code' section at the bottom):
http://railscasts.com/episodes/31-formatting-time?view=asciicast