[Rails] Re: Generating a unique id ?

Jan Prill jan.prill at gmail.com
Tue Aug 8 19:36:24 GMT 2006


Another possibility would be to 'gem install uuid' .

Read the README of this gem and use it within your rails code.

Cheers,
Jan

On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:
>
> nuno wrote:
> > Francis Cianfrocca wrote:
> >>
> >> In Ruby: `uuidgen` will work under both unix and windows.
> >
> > Okay !! I thought it was a method name... But what is the meaning of
> > these strange quotes `` ???
>
> Read the Ruby language docs: enclosing a string in backticks causes it
> to be executed in a shell. You can put arbitrarily complex commands in
> there, same as you would at a shell prompt. You can also put #{...} as
> in a Ruby double-quoted string. Your program stops running until the
> command completes, and in Ruby, you get back a String which contains
> whatever the command wrote to stdout.
>
> uuidgen is present on Windows, definitely, but doesn't support the -r
> option you often find on Unix. So just use it without -r.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060808/e1cc79ff/attachment-0001.html


More information about the Rails mailing list