Class: Captcher::CaptchasController

Inherits:
ActionController::Base
  • Object
show all
Includes:
CaptchaAware
Defined in:
app/controllers/captcher/captchas_controller.rb

Instance Method Summary collapse

Methods included from CaptchaAware

#confirm_captcha, #load_captcha, #reload_captcha

Instance Method Details

#confirmObject



14
15
16
17
18
19
20
# File 'app/controllers/captcher/captchas_controller.rb', line 14

def confirm
  if confirm_captcha?(session, params[:confirmation])
    render json: { success: true }, status: 200
  else
    render json: { success: false }, status: 422
  end
end

#reloadObject Also known as: refresh



9
10
11
# File 'app/controllers/captcher/captchas_controller.rb', line 9

def reload
  render_captcha(reload_captcha(session))
end

#showObject



5
6
7
# File 'app/controllers/captcher/captchas_controller.rb', line 5

def show
  render_captcha(load_captcha(session))
end