title: Working example of new recaptcha with Rails?
body: <p>Does anyone have a working example of Google's new recaptcha in a Rails app? Every guide I try to follow is either unclear or incomplete, and seems to use a different method.</p>
  
  <p>Hand-rolled code would be preferable.</p>
  
  <hr>
  
  <p><strong>Work in Progress:</strong></p>
  
  <p>config/environments/production.rb:</p>
  
  <pre><code>  #...
    recaptcha_public_key= "[PUBLIC KEY]"
    recaptcha_private_key= "[PRIVATE KEY]"
  end
  </code></pre>
  
  <p>config/environments/development.rb:</p>
  
  <pre><code>  #...
    recaptcha_public_key= "[PUBLIC KEY]"
    recaptcha_private_key= "[PRIVATE KEY]"
  end
  </code></pre>
  
  <p>config/initializers/recaptcha.rb</p>
  
  <pre><code>Recaptcha.configure do |config|
    config.public_key  = Rails.application.secrets.recaptcha_public_key
    config.private_key = Rails.application.secrets.recaptcha_secret_key
    config.api_version = 'v2'
  end
  </code></pre>