Class: RuCaptcha::CaptchaController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/ru_captcha/captcha_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



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

def index
  return head :ok if request.head?
  headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
  headers['Pragma'] = 'no-cache'
  data = generate_rucaptcha
  opts = { disposition: 'inline', type: 'image/gif' }
  send_data data, opts
end