ruby create field random 6 digit code example Example: generate 6 digit random number ruby 10.times.map{rand(10)}.join # => "3401487670"