Archive for December, 2008
- A Rails log parser to show how your actions are performing - December 31st, 2008
I’ve been battling with some performance issues on a Rails project I’m working on and I wanted to see which actions could be the culprit.
I wrote a quick log parser which will read a log file and print out the call time information by controller#action. It supports sorting by various columns and outputs the results [...] - Automatically handle unexpected Ajax errors in Rails - December 30th, 2008
I’m busy working on a project that uses a lot of Ajax to deal with updates and lookups etc. Occasionally I write rubbish code and one of these methods break.
When using normal HTML this is not a problem because Rails presents the user with a nice message saying “We’re sorry but something went wrong…”.
But, with [...] - Display your current GIT branch in your prompt - December 29th, 2008
I spotted a customised prompt on someone’s computer and remembered that you can control what’s displayed in your prompt. This led to an immediate Ah-ha moment that I should display my current working GIT branch there to stop having to keep running git branch to remember which branch I’m working in.
I quickly Googled to see [...] - How to use the new templates in Rails - December 27th, 2008
One of the new features in the upcoming Rails 2.3 is templates. I’ve been playing around with them and have documented some ways of using them below.
To start with, there’s a great write-up on most of the template methods on Pratik Naik’s blog
I want to play with some ideas around how you can further customise [...] - How to update the Rails scaffold generator to suit your own applications - December 27th, 2008
Learn about how to extend the built-in Rails scaffold generator to modify it to suite your personal coding style.
- Hello world! - December 26th, 2008
Every good programmer needs to start with Hello World so this is it, making sure all works and then I can start with some real content.

