=NiceIds

The NiceIds plugin allows for human readable <tt>id</tt>s in URLs.  By declaring
which attribute you wish to be used as the +id+ in your ActiveRecord model, 
the NiceIds plugin overrides the +to_param+ and +find+ methods to use that
parameter:

  # Users have nice IDs
  class Users < ActiveRecord::Base
    nice_id :username
  end

  # Create a user
  user = User.new :username => "jdoe"
  
  # The original find still works
  user == User.find(user.id) # => true
  
  # Can be found using the "username" attribute
  user == User.find(user.username) # => true
  
  # Also overrides to_param
  user.to_param # => "jdoe"

The URL-ized form of the property is stripped of all non-alphanumeric
characters, all letters are lowercased, and all empty spaces are replaced
with dashes:

  user = User.new :username => "Don't ever use this as a username!!!"
  user.to_param # => "dont-ever-use-this-as-a-username"

The nice id is stored in the database in a column named "nice_id".  To
change the name of the column, use the <tt>:column</tt> attribute:

  # Using an alternate column for the nice id field
  class User < ActiveRecord::Base
    nice_id :username, :column => "mean_id"
  end

Copyright (c) 2009 Jonathan Bryant, released under the MIT license
