A better Array#rand
This plugin overrides the Array#rand method that Rails gives you to support not only getting a single random element of the array back, but also a random subset of elements (as an array) from the source array.
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
This plugin overrides the Array#rand method that Rails gives you to support not only getting a single random element of the array back, but also a random subset of elements (as an array) from the source array.
Post a comment