Sha256: 57a72f2062c982b71b64d1bdd8ed45ed2acc54ab12895444b6a849d65e08e200
Contents?: true
Size: 604 Bytes
Versions: 17
Compression:
Stored size: 604 Bytes
Contents
require 'recaptcha' class Filters::RadCaptchaFilter def initialize controller @controller = controller end def self.filter controller Filters::RadCaptchaFilter.new(controller).verify end def verify unless verify_captcha @controller.send :head, :bad_request, :ErrorMsg => "The security code that you entered does not match the one in the image. Please enter the security code again." end end private def verify_captcha @controller.extend Recaptcha::Verify @controller.verify_recaptcha(:private_key => Rails.configuration.captcha_private_key) end end
Version data entries
17 entries across 17 versions & 1 rubygems