Class: SimpleCaptchaController

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

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



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

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