Class: SimpleCaptchaController

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

Overview

class SimpleCaptchaController < ActionController::Metal

Constant Summary

Constants included from SimpleCaptcha::ImageHelpers

SimpleCaptcha::ImageHelpers::DISTORTIONS

Instance Method Summary collapse

Methods included from SimpleCaptcha::ImageHelpers

distortion, image_params

Instance Method Details

#showObject

GET /simple_captcha



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/simple_captcha_controller.rb', line 9

def show
  unless params[:id].blank?
    send_file(
      generate_simple_captcha_image(params[:id]),
      :type => 'image/png',
      :disposition => 'inline',
      :filename => 'simple_captcha.png')
  else
    self.response_body = [404, {"Content-Type" => "text/html"}, ["Not Found"]]
  end
end