Module: Traptcha::ControllerHelpers
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/traptcha/controller_helpers.rb
Instance Method Summary collapse
Instance Method Details
#valid_captcha? ⇒ Boolean
9 10 11 |
# File 'lib/traptcha/controller_helpers.rb', line 9 def valid_captcha? params[:captcha] && params[:secure_hash] && Traptcha::Captcha.new(params[:captcha]).value == params[:secure_hash] end |
#validate_captcha ⇒ Object
13 14 15 |
# File 'lib/traptcha/controller_helpers.rb', line 13 def validate_captcha raise Traptcha::InvalidCaptcha unless valid_captcha? end |