Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Acts As Tiny Url

Acts As Tiny Url

ActsAsTinyURL utilizes TinyURL’s API to allow you to pass in any URL and have it generate a shortened URL on the fly.

If you want one of your model’s to be able to use ActsAsTinyURL, just add the following line right under the class declaration of one of your controllers.

include ActsAsTinyURL

Options

The validate_uri option allows you to check, before trying to retrieve a URL, whether or not it is formatted correctly.

Example Usage

tiny_url(“http://brendanlim.com”)
  1. returns http://tinyurl.com/3274fk
tiny_url(“http://brendanlim.com”, :validate_uri => true)
  1. returns true
tiny_url(“http/brendanlim.com”, :validate_uri => true)
  1. returns false

Copyright© 2008 Brendan G. Lim (brendangl@gmail.com), released under the MIT license

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly


Homepage: http://brendanlim.com

Users


See all 3 member details


Membership

+ Join this railsplugin

Record Maintainer

Brendan Lim