Class: DalliCaptcha::CaptchaController

Inherits:
ApplicationController show all
Defined in:
app/controllers/dalli_captcha/captcha_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/dalli_captcha/captcha_controller.rb', line 3

def show
  captcha = DalliCaptcha::Image.new(session[:captcha_key])
  tempfile = captcha.generate
  if tempfile
    send_file(tempfile.path, :type => captcha.content_type, :disposition => 'inline', :filename => captcha.filename)
  else
    render :nothing => true
  end
end