1. Computing
Send to a Friend via Email

URL Shortener in Rails 3

A URL shortener is an extremely simple application you can implement using Ruby on Rails. While it's anything but intensive, it does serve to illustrate some basic concepts in Rails as well as explore the Rails URL router, something you don't usually touch directly when using RESTful resources.

Creating a URL Shortener in Rails
The following is a list of articles, each detailing a step in the creation of a URL shortening service (a la TinyURL.com or bit.ly) with Ruby on Rails. It covers the Rails aspects, integrating a style and deploying on Heroku.

Part 1: Brainstorming
If you're just starting out, you may be itching for some easy but practical projects to try out your new Rails skills. A URL shortener is one of these projects, it allows you get a feel for the routing, a few tweaks to the model and it's something you can integrate into any of your projects down the road.

Part 2: Bootstrapping
In this article, we'll explore our intended implementation and what it means as the Rails router is concerned.

Part 3: Implementing
In this part, we'll implement (more or less) the rest.

Part 4: Styling
Now that we have a working URL shortening application, let's get rid of those blank, boring white pages and add some style.

Part 5: Deploying
Now that the application is functional and styled, we can deploy it on the awesome (and free) Heroku.

©2014 About.com. All rights reserved.