Skip to content

Instantly share code, notes, and snippets.

@orodio
Created January 4, 2013 06:11
Show Gist options
  • Save orodio/4450318 to your computer and use it in GitHub Desktop.
Save orodio/4450318 to your computer and use it in GitHub Desktop.
def protect
chars = ('a'..'z').to_a - ['a','e','o','u','i'].to_a
#chars = ('a'..'z').to_a
code_array=[]
1.upto(6) {code_array << chars[rand(chars.length)]}
session[:code] = code_array.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment