Bounga / Acts_as_nice_url (http://bitbucket.org/Bounga/acts_as_nice_url/)
A Ruby on Rails plugin to generate pretty URLs from models data
$ hg clone http://bitbucket.org/Bounga/acts_as_nice_url/
NiceUrl
This acts_as extension provides the capabilities for creating a nice url based on an attribute of the current object. You can set / unset the object id in front of the URL and choose the object attribute to use to generate the URL.
Installation
In your Rails app root, use the following command-line :
or install it system-wide :
and require it in Rails::Initializer (environment.rb) :
Example
In your model :
then in your views :
or
Use id only in some case
If you want to use the id only in the generated URL, you have to fill the id parameter with the id only, not the full object :
or
Other
If you want to contribute you should take a look at:
You can take a look at RDoc too.
Problems, comments, and suggestions are welcome on the ticket system
Copyright (c) 2008 Nicolas Cavigneaux, released under the MIT license
This revision is from 2008-12-08 16:11
