Port of the URL Shortener from Sinatra to rails, worked with @thefenry