Class: QuickCaptchaController

Inherits:
ActionController::Base
  • Object
show all
Includes:
QuickCaptcha::ImageHelpers
Defined in:
app/controllers/quick_captcha_controller.rb

Overview

Copyright © 2008 [Sur expressica.com]

Constant Summary

Constants included from QuickCaptcha::ImageHelpers

QuickCaptcha::ImageHelpers::IMAGE_STYLES

Instance Method Summary collapse

Methods included from QuickCaptcha::ImageHelpers

#generate_simple_captcha_image

Instance Method Details

#showObject Also known as: simple_captcha

:nodoc



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/quick_captcha_controller.rb', line 6

def show  #:nodoc
  simple_captcha_key = params[:simple_captcha_key] || params[:captcha_key]
  raise ":simple_captcha_key parameter missing" unless simple_captcha_key
  send_data(
    generate_simple_captcha_image(
      :image_style => params[:image_style],
      :distortion => params[:distortion], 
      :simple_captcha_key => simple_captcha_key),
    :type => 'image/jpeg',
    :disposition => 'inline',
    :filename => 'simple_captcha.jpg')
end