Class: IqCaptcha::CaptchaController

Inherits:
ApplicationController show all
Defined in:
app/controllers/iq_captcha/captcha_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
# File 'app/controllers/iq_captcha/captcha_controller.rb', line 7

def index	    
    captcha = Captcha.new(params[:pointsize],params[:color_code])
    question, answer = captcha.generate_question_answer
    captcha = captcha.generate_captcha(question)
    session[:iq_captcha_answer] = answer
    send_data captcha.to_blob, :stream => 'false', :filename => 'captcha.jpg', :type => 'image/jpeg', :disposition => 'inline'	
end