Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a8fbbb0b61
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 14 lines (12 sloc) 0.285 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
require 'captcha'

ActionController::Base.send :include, CaptchaActions

to = "public/images/captchas"
unless File.exists?(to)
  FileUtils.mkdir_p to
  (0..99).each do |x|
    c = Captcha.new(6)
    File.open("#{to}/#{c.code}.jpg", 'w') do |f|
      f << c.code_image
    end
  end
end
Something went wrong with that request. Please try again.