Forums » Ruby on Rails » Ruby : Shuffle your Arrays
From Ruby 1.8.7 on, elements of an Array can be ordered at random using the shuffle method:

a = [ 1, 2, 3 ] #=> [1, 2, 3]
a.shuffle #=> [2, 3, 1]