You can use ruby's standard library to trivially generate random url-safe tokens.
any drawback or benefit to using SecureRandom.uuid?
This is close, but not quite 100% unique. One method I've been using is to append the id of the record to the value, in order to ensure 100% unique value. The only downside is that it increases the length / gives an inconsistent link.