Using the Ruby on Rails web framework – How to install Rails and create a simple blog (Part 1)

VN:F [1.9.22_1171]
Rating: 3.7/5 (7 votes cast)

This is a beginner’s guide to installing Ruby on Rails and creating a simple, secured blog relatively fast. Ruby on Rails is an open source MVC web application framework based on the Ruby programming language. It’s intended to be used with an agile development methodology that is used by web developers for rapid development. If you’ve not heard about the Agile development or the MVC concept, please read about them first, as you need to know about their basics to be able to understand all parts of this tutorial. Very basic knowledge of HTML and Ruby will be needed, too.

By default Ruby on Rails includes tools that make web development easier, such as scaffolding that can automatically construct some of the models and views needed for a basic website. Other tools are WEBrick, a simple Ruby web server and Rake, a build system. Together with Rails these tools provide a basic development environment.

Warning! I’ve created this simple blog application on my own web space that’s was hosted by Hostmonster, installing and using Ruby on Rails on other web hosting providers’ web spaces may (probably) be different and many of them won’t even support Rails. As I moved my website to an other hosting provider in January 2012, the working examples are no longer available here.

Before you start installing, I need to warn you again, that this guide is Hostmonster specific and the installation bit will only work if you have a Hostmonster account. If you’re not with Hostmonster, but you have Ruby on Rails set up on a different host or on your computer, skip steps 1, 2, and 3.

1. Prerequisites

If your developing on Hostmonster, you need to have SSH access enabled. Here’s how to do this on Hostmonster.

WEBrick isn’t necessary on a Hostmonster account and you’re not supposed to use it. This is because Hostmonster wants you to develop on their server instead of developing your Ruby on Rails application on your own computer where there might not be an Apache install which is pre-configured to use Rails on Hostmonster. “Yay” for the pre-configured Apache, but “Booooooo” for forcing us to develop on the server…

Also, you should use MySQL on your Hostmonster account, hopefully this isn’t an issue.

2. Installing Rails on Hostmonster

To begin, log into the Hostmonster server using SSH (I use the free PuTTY software as an SSH client, but there are many similar ones on the net to download).

PuTTY - Logged in

You’ll create a work directory and then cd into it. You can name it whatever you would like, such as “myrails”…

mkdir ~/myrails

cd ~/myrails

Create an application called “myblog”. How you create the application depends on what version of Rails is running on the Hostmonster server (currently 2.3.5). To find it out use the following command…

Continue reading »


Using the CodeIgniter PHP web framework – How to create a simple secured blog in 30 minutes

VN:F [1.9.22_1171]
Rating: 4.0/5 (74 votes cast)

This is a beginner’s guide to installing CodeIgniter and creating a simple, secured blog in about 30 minutes. CodeIgniter is an open source MVC web application framework with a very small footprint. Its aim is to enable developing projects much faster than writing code from scratch, by providing a set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries.

If you’ve not heard about the MVC concept, please read about it first, as you need to know about its basics to be able to understand all parts of this tutorial. Basic knowledge of HTML and PHP will be needed, too.

Although I’ve created this simple blog application on my own web space that‘s was hosted by Hostmonster, using other web hosting companies’ solutions shouldn’t be a problem, if they have PHP and MySQL installed on their servers.
Warning! As I moved my website to an other hosting provider in January 2012, the working examples are no longer available here.

1. Installation

Download CodeIgniter from their website. Unzip it. Create a folder named “yourfolder” (or whatever you want to call it) on your web space inside any www or public_html folder and upload the CodeIgniter folders and files into this folder.

Open the application/config/config.php file with a text editor (I use Notepad++) and set your base URL (e.g. – “” being your domain and “yourfolder” is the folder you just uploaded the CodeIgniter files to).

Open the application/config/database.php file with a text editor and set your database settings. Most web hosts provide users with “How to set up your database” guides, if you’re not sure how to do this, look them up on your host’s website.

2. Creating the “blog” controller

Create a file called blog.php in the “controllers” folder. this is going to contain your first custom CodeIgniter controller, called “Blog”.

Add the “index” function to the controller to test it is working…


class Blog extends Controller {
   function index()
      echo "hey!";


Now displays…


Go, check it out, it should look something like this…
Browser displays "hey!" Continue reading »


The dangers of tweeting your location

VN:F [1.9.22_1171]
Rating: 4.2/5 (6 votes cast)

Twitter has a new feature that allows users to add location information to their tweets. Of course the feature is turned off by default, so Twitter won’t reveal private information about your whereabouts unless you want it to do so.

Those who would like to opt-in will be able to add their location information to individual tweets through Twitter and using other applications or mobile devices that support this feature. The location information that is shared publicly can be either your exact location (coordinates) or your place (such as a city or a neighbourhood). You can opt-in by accessing your Twitter settings and ticking this box:

Twitter settings to opt-in to the location feature

The new status updates will look similar to this (if you’re using Firefox 3.5+ or Google Chrome or you have Google Gears installed on an other/older browser:

Tweet with added location information

Twitter claims that “tweeting with your place or coordinates can add context to your updates and help you join the local conversation, wherever you are”. Now that might be true, but they forgot to properly warn their users about the possible risks of using this feature.

Continue reading »


Don’t panic when you look at your website’s Page Speed results…

VN:F [1.9.22_1171]
Rating: 3.4/5 (5 votes cast)

When developing a web site, using Page Speed (you know, the Firebug plugin) is quite important, as it can give you advice on how to speed up your website’s download time.

When you click the “Analyze Performance” button, it runs numerous tests and warns you about the major and minor issues that could slow down your website’s download.
When I checked the homepage of, it gave me the result of 86/100 and my blog got 84/100.

I was thinking “hmm, should I try to minimise the number of DNS lookups and specify element expiration?”, but then instead of answering the question without any research on the subject, I did a Page Speed test on a couple of mainstream and web designers’ websites. The results mean, that panicking isn’t necessary:

Twitter: 92
Twitter – logged in: 91
Google: 90
BBC: 87
Facebook: 85
Facebook – logged in: 84
Shaun Inman: 83
Ryanair: 82
Microsoft: 81
Jason Santa Maria: 79
Sarah Parmenter: 78
Elliot Jay Stocks: 76
Apple: 75
CNN: 74
T-Mobile UK: 74
Lloyds TSB: 72
EasyJet: 71
British Airways: 67
Scottish Hydro: 66

These numbers suggest that your website will do OK if its Page Speed result is above 70-75.

Conclusion: it’s probably a better idea to focus on graphic design and functionality first, and when everything’s nice and working fine, then you can look into speeding up your website.

Update: Google Webmaster Central Blog just posted a new article on site speed, it might be worth checking out.


No, I’m not supporting IE6

VN:F [1.9.22_1171]
Rating: 4.8/5 (4 votes cast)

I’d been recently involved in a discussion about Internet Explorer 6.

Should us web designers still apply all the tricks and hacks we’ve been using since 2001?
My answer is: God no!

Since Google stopped supporting IE6 and YouTube followed them as well (no surprise!), IE6 users will suffer every time they want to use anything advanced on the Internet. Google Docs: nope, won’t work! YouTube: nah, not watching videos here, mate.

I am thankful that the day has come. We’ve been waiting for 9 years! Oh and no, I don’t care if anyone accesses my websites using IE6. I can only hope that the disappointment experienced here, on YouTube and on Google’s sites will finally make them start using a better browser.

PS. I use Chrome for everyday browsing and Firefox for web development.