Plugin details

The UrlKey module creates an unchanging permalink identifier for a model object.

1. URL keys are guaranteed to be unique by appending of a count.
2. URL keys are only generated on create, so they never change

Websitehttp://railspikes.com/2007/5/15/using-urlkey Repositorysvn://rubyforge.org/var/svn/slantwise/url_key/trunk Author Slantwise Design Tags seo, url LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/slantwise/url_key/trunk

In your linkable models, include the following:

class Thingy < ActiveRecord::Base
    has_url_key :title
end



This assumes you have a column called +url_key+ defined in your model. If your field is named differently, you can specify it like this:

class Thingy < ActiveRecord::Base
    has_url_key :title, :permalink
end



When a record is created, a unique url_key based on the :title column will automatically be created.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 9 months ago