| Path: | vendor/plugins/url_key/README |
| Last Update: | Thu May 31 11:07:16 -0500 2007 |
The UrlKey module creates an unchanging permalink identifier for a model object.
It is like Rick Olson‘s PermalinkFu plugin with a couple of changes:
Install the plugin with:
script/plugin install svn://rubyforge.org/var/svn/slantwise/url_key/trunk url_key
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.
Copyright (c) 2007 Slantwise Design. Released under the MIT license.