Class: IqCaptcha::CaptchaController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IqCaptcha::CaptchaController
- Defined in:
- app/controllers/iq_captcha/captcha_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |