Feb01

Announcing Tweet Fighter

twitter ruby sinatra sequel projects thin

Firstly: allow me to bash the bible for a few lines. Over the past year or so I’ve become enamoured with Sinatra, the Ruby microframework. I’ve toyed with it, pushed it around, made it do things it didn’t want to do, locked it out in the cold and like a terminally happy pet, it still keeps coming back for more. Sinatra’s versatility is a product of its simplicity – it does its job well and the rest is up to you. Anyway, enough proselytising… on to Tweet Fighter.

comments | Continue reading »

Sep14

Rails multiple select helper

ruby rails form tag helpers habtm

I’ve just written a little Rails helper to output a multiple select tag with the correct options selected by default. I’ve always struggled with this when working with a HABTM relationship in Rails apps, so thought it was about time to come up with my own solution. As far as I’m aware, collection_select is generally the preferred helper in this situation but I found that it clashed with my brain in the worst way.

comments | Continue reading »

Jul02

Practical uses for Sammy

sammy javascript quirkey jquery cycle accordion rest

I’ve recently been looking into a new Javascript framework named Sammy, written by the most excellent Aaron Quint. It was built on top of jQuery and intended to allow developers to build one-page applications, utilising the URL hash (the portion of the URL from the # symbol onwards) usually reserved for on-page anchors to give Javascript functions lovely RESTful routes.

comments | Continue reading »

May21

Two hours with Sinatra

ruby sinatra thin simplelog blogging scanty twitter last.fm hpricot json

Recently I decided to spruce up this site. It had been languishing – as many personal sites do – in the realm of uninspired drivel, amounting to a few pointless paragraphs and a contact form which nobody used. Nice. Last year I had set up simplelog, a Rails-based blogging engine, with the intention of occasionally writing informative articles on my web development exploits. As an application, simplelog was brilliant: easy to use and relatively low on feature bloat. However, soon afterwards my enthusiasm began to wane. Partly because for some reason simplelog is no longer supported, which leaves me to maintain someone else’s out-of-date code, gem dependencies and so on. But mainly because I realised… being a web developer is all about getting your hands dirty, right? A lot of the fun of running a site (for me at least) is starting from a point of my own choosing, maintaining my own code and making feature modifications as and when I see fit.

comments | Continue reading »

Apr16

British date formatting with Rails

ruby rails helpers date datetime activesupport

Here’s a little helper for UK Rails users when formatting a Date or DateTime object in your view.

I looked around for quite a while before I discovered the term ‘ordinalize’, so I hope this helps someone. Dates can be so America-centric sometimes (no hard feelings, State–side homeboys).

comments | Continue reading »
View archived posts