app/controllers/contacts_controller.rb
# verify reCaptcha was valid
#
# rubocop:disable Metrics/MethodLength
verify reCaptcha was valid
rubocop:disable Metrics/MethodLength
verify reCaptcha was valid rubocop : disable Metrics / MethodLength
def check_captcha
    return unless GoogleRecaptcha.enabled?
    @contact = Contact.new(contact_params)
    @contact.valid? 
    success = verify_recaptcha(
      action: 'contact',
      model: @contact,
      attribute: :recaptcha,
      minimum_score: GoogleRecaptcha.minimum_score,
      secret_key: GoogleRecaptcha.secret_key
    )
    render :new unless success
  end
def check_captcha return unless GoogleRecaptcha . enabled? @contact = Contact . new ( contact_params ) @contact . valid? success = verify_recaptcha ( action : 'contact' , model : @contact , attribute : :recaptcha , minimum_score : GoogleRecaptcha . minimum_score , secret_key : GoogleRecaptcha . secret_key ) render :new unless success end
verify reCaptcha was valid
rubocop:disable Metrics/MethodLength
verify reCaptcha was valid rubocop : disable Metrics / MethodLength
# return if recaptcha is not enabled # Look for any other validation errors besides reCAPTCHA