This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sat Jul 19 08:06:09 -0700 2008 | [fnando] |
| |
README | Sat Jul 19 08:06:09 -0700 2008 | [fnando] |
| |
init.rb | Sat Jul 19 08:06:09 -0700 2008 | [fnando] |
| |
lib/ | Sat Jul 19 08:06:09 -0700 2008 | [fnando] |
| |
test/ | Sat Jul 19 08:06:09 -0700 2008 | [fnando] |
README
has_permalink
=============
Instalation
-----------
1) Install the plugin with `script/plugin install git://github.com/fnando/has_permalink.git`
2) Install the unicode gem with `sudo gem install unicode`
Usage
=====
1) Add the method call `has_permalink` to your model. Your model should have a 'permalink' attribute.
class Page < ActiveRecord::Base
has_permalink :title
end
You can specify the permalink field:
class page < ActiveRecord::Base
has_permalink :title => :title_permalink
end
If you don't want to use has_permalink, you can call 'some text'.to_permalink string method.
NOTE: Permalinks are not unique. Remember to override to_param method as follow:
def to_param
"#{id}-#{permalink}"
end
By overriding to_param method you don't have to change a thing on your app routes. ;)
The permalink is created when after_validation callback is evaluated. This plugin also tries
to generate a permalink when before_save callback is evaluated and the instance has no permalink set.
Copyright (c) 2008 Nando Vieira, released under the MIT license



