norman/friendly_id — Issue #192: Cannonical URL's 
Author: schneems
Created: 2011-11-30 17:37:01+00:00
State: open

I'm interested in doing two things with friendly_id right now and i'm having trouble figuring out how to do either.

## First, Cannonical url

I'm using friendly ids on a model attribute that can be edited, such as name, yet i want the url to work regardless of the name. So I would like to set

```ruby
user = User.where(:name => 'schneems')
user.id # => 9
user.friendly_id # => "9-schneems"
```

So when the name changes, the url still works

```ruby
user.update_attributes :name => 'theschneems'
user.friendly_id #=> "9-theschneems"
```

## Second, Obfuscated IDs

Assuming I can get the above to work, I would like to hide the ids of my users by doing something like base58 on the id, so it's not obvious by looking at the url exactly what user number a person is.

```ruby
user.id #=> 99
Base58.encode(user.id) #=> "2H"
user.friendly_id #=> "2H-schneems"
```

While I do see something about sequencing, and separating the sequence, i'm not sure how to set the sequence field

Let me know if this is possible given the current state of friendly_id. I poked around for awhile and couldn't find a painfully obvious way to do either of these things.