Class: EasyCaptcha::CaptchaController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/easy_captcha/captcha_controller.rb

Overview

captcha controller

Instance Method Summary collapse

Instance Method Details

#captchaObject

captcha action send the generated image to browser



6
7
8
9
10
11
12
# File 'lib/easy_captcha/captcha_controller.rb', line 6

def captcha
  if params[:format] == "wav" and EasyCaptcha.espeak?
    send_data generate_speech_captcha, :disposition => 'inline', :type => 'audio/wav'
  else
    send_data generate_captcha, :disposition => 'inline', :type => 'image/png'
  end
end