views:

37

answers:

1

I want to create a web app similar to http://www.pastebin.com/ in Ruby on Rails. pastebin.com uses a random string to identify an item. Ruby on Rails uses an auto-incrementing number. How can I make Ruby on Rails also use these random strings as IDs for items, instead of auto-incrementing numbers?

Thanks

A: 

I believe you can override the implementation of to_param in the models of interest. There's a fuller explanation of the technique here

bjg