I need to generate uuid for my rails application. What are the options(gems) I have?

Virtual picture Virtual · Aug 14, 2013 · Viewed 68k times · Source

I use Rails 3.0.20 and ruby 1.8.7 (2011-06-30 patchlevel 352)

Please suggest me the best plugin to generate guid.

Answer

apneadiving picture apneadiving · Aug 14, 2013

There are plenty of options, I recommend not to add additional dependencies and use SecureRandom which is builtin:

SecureRandom.uuid #=> "1ca71cd6-08c4-4855-9381-2f41aeffe59c"

See other possible formats here.