Coder Social home page Coder Social logo

recaptcha's Issues

Validation errors before validation

There is a condition where recaptcha_tags will display errors on the captcha text box before a validation has occurred.

When using recaptcha on a popup window, typing in an empty or invalid re-captcha, the recaptcha_error session is set with the error. Close the window without typing in a correct captcha, and you will see the captcha text field (red) as if it had failed validations, on all subsequent page loads.

This assumes you are passing the model to verify_recaptcha, and using error_messages_for to display form validations.

John

installing as gem for rails

i took some time to figure out how to use this as a gem (not plugin) with rails.

may be the following solution for rails 2.3.5 should be included in the docs:

install the gem normally with "gem install recaptcha". then create a file in initializers/recaptcha.rb containing:

require "recaptcha/rails"
ENV['RECAPTCHA_PUBLIC_KEY'] = 'xxx'

ENV['RECAPTCHA_PRIVATE_KEY'] = 'yyy'

Release new updated gem

The 0.3.1 is actually broken for Rails 3.x but unpacking the gem with latest commits does work.

Can you please release the updated gem on rubygems?

500 accounts created per day - all with "correct" recaptchas

Anyone experienced anything like this? Has the OCR gotten good enough to beat it?

Over a 3 hour sample, 114 correct recaptchas submitted, 43 failures. 95% spammers at least. Unique IPs, very well done except all the usernames are "word" "two-digits" "word", which helps to see which are real.

None of the bots have done anything more than try to post a link to a casino or other website (which are all nofollowed anyways)

I'm logging the captcha responses and they look sane - doesn't seem to be any easy way to load a recaptcha from the recpatcha_challenge_field token for debugging.

I've tested it as myself and it's def. not accepting invalid inputs.

Any other experiences like this, or suggestions? Thanks!

development mode

Would be nice if you added an option to "disable" the check in development environment (so that verify_recaptcha would just return true).

Display option does not work with :ajax set to true

The offending line is line 20 of lib/recaptcha/client_helper.rb:

It should be:

    html << %{  Recaptcha.create('#{key}', document.getElementById('dynamic_recaptcha')#{options[:display] ? ',RecaptchaOptions' : ''});}

Instead of: html << %{ Recaptcha.create('#{key}', document.getElementById('dynamic_recaptcha')#{options[:display] ? '' : ',RecaptchaOptions'});}

The outcomes for options[:display] are reversed: if there is an options[:display] then add the RecaptchaOptions, otherwise don't bother.

Let me know if I can help further. Cheers for the gem: it's great!

support proxy config

this project does not support passing proxy configuration for captcha validate

recaptcha-not-reachable

I install recaptcha a few day ago and add to my application. Until today, recaptcha was work fine but now it appear the message "recaptcha-not-reachable" everytime, i don't why. whats can be wrong?

net/http

Hi

Using ruby 1.8.7, rails 2.3.4 and recaptcha 0.2.2 as a gem, require 'net/http' is mandatory in environment.rb else the verify_captcha method raises a Recaptcha::RecaptchaError exception "uninitialized constant Net::HTTP"

Please require 'net/http' in the init.rb :)

Best

Issue with playing as audio

Hi,

We have a registration page in our system which we are protecting using recaptcha. The visual challenge works fine; hence I think my settings are correct. However, when I click the audio challenge, I do not hear any sound. Even clicking 'Play sound again' does not work - the view source do not show link to google recaptcha, just a '#'. Can anyone please point out what can possibly go wrong..?

Any help/suggestion is highly appreciated.

Ruby 1.9.1 issue

.verify_recaptcha raises exception in Ruby 1.9.1:

Ambethia::ReCaptcha::ReCaptchaError (can't dup Symbol)

Patch: antage@84b128863a7dc9bfe792e286768534dd5338ec82

Bring gem up to date

I took interest in your gem today when I decided I needed to add a captcha to an application I'm working on. Overall, the gem seemed simple and intuitive. I ran into some minimally discussed problems concerning Net::HTTP and it took me some time to track down the issue.

It looks like your master branch works fine, but it seems it has been some time since the hosted gem has been updated. I also noticed that your Recaptcha::VERSION module is way out of date.

This is not a complaint by any stretch. I completely understand being busy and not being able to get to side projects. I just didn't want to jump in offering pull requests without starting a discussion. Would it help you to bring your versioning back into some semantic line? Are there other outlying issues that have prevented you from going ahead with publishing a new gem?

If I can help, please let me know :)

Rails 4 integration

I'm using the reCaptcha gem in my Rails 4 app, and the tag for recaptcha isn't displaying, after reloading the page it renders correctly but I suspect that this is caused for the way Turbolinks works in Rails 4 apps..
Have thought about in update the gem to be compatible with Rails4 apps?
How can I do to avoid this?
Thanks!

Helper generates invalid markup

The helper currently generates invalid xhtml. Can be fixed with a couple of tweaks:

diff --git a/vendor/gems/recaptcha-0.2.3/lib/recaptcha/client_helper.rb b/vendor/gems/recaptcha-0.2.
index 213ba3e..4ee93df 100644
--- a/vendor/gems/recaptcha-0.2.3/lib/recaptcha/client_helper.rb
+++ b/vendor/gems/recaptcha-0.2.3/lib/recaptcha/client_helper.rb
@@ -22,7 +22,7 @@ module Recaptcha
         html << %{</script>\n}
       else
         html << %{<script type="text/javascript" src="#{uri}/challenge?k=#{key}}
-        html << %{#{error ? "&error=#{CGI::escape(error)}" : ""}"></script>\n}
+        html << %{#{error ? "&amp;error=#{CGI::escape(error)}" : ""}"></script>\n}
         unless options[:noscript] == false
           html << %{<noscript>\n  }
           html << %{<iframe src="#{uri}/noscript?k=#{key}" }
@@ -32,7 +32,7 @@ module Recaptcha
           html << %{<textarea name="recaptcha_challenge_field" }
           html << %{rows="#{options[:textarea_rows] ||= 3}" }
           html << %{cols="#{options[:textarea_cols] ||= 40}"></textarea>\n  }
-          html << %{<input type="hidden" name="recaptcha_response_field" value="manual_challenge">}
+          html << %{<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />}
           html << %{</noscript>\n}
         end
       end

Errors in verify.rb (Using Sinatra)

In my sinatra application recapcha gem return some errors:

  1. undefined method `remote_ip' for #Sinatra::Request:0x7fdc7e4f8820
    file: verify.rb
    location: verify_recaptcha
    line: 30
    I solve this by change in verify.rb request.remote_ip to request.ip

  2. undefined local variable or method `flash' for #MyServer:0x7f9ac350e0c8
    file: verify.rb
    location: verify_recaptcha
    line: 55
    This error i solved by adding flash = [] before "unless answer == 'true'"
    But if i write correct capcha all works fine, if i wrote wrong answer i got errors like Symbol as array index in line 38 of verify.rb or error about converting symbon to integer. I commented all in unless-else-end exept "return true" and "return false". When i do that - check of capcha retun error or pass from my app.

My test application: https://github.com/ssic7i/samples-here/blob/master/test_http.rb
My view for test application: https://github.com/ssic7i/samples-here/blob/master/check.erb

Not compatible with Rails 2.3.5

Method recaptcha_tags throws an error at client_helper.rb line 39 because
html_safe is not available in Rails 2.3.5.
The current version of rails_xss seems to require Rails 2.3.8.

Changing client_helper.rb line 39 to:
return (html.respond_to?(:html_safe) && html.html_safe) || html
fixes the issue.

recaptcha_tags - unable to use :display option with :ajax=>true

Recently I tried to add reCapcha to a form submited by remote_form_for method. In order to display reCaptcha properly after submit, I had to pass :ajax=>true option in recaptcha_tags method.

I also tried to customize look and feel of reCaptcha using :display option with something like this:

recaptcha_tags :display=>{:theme=>'white'}, :ajax=>true

but id doesn't seem to work. However, if I use it without :ajax=>true, it works good and display options are working. I could abandon using ajax form to use normal form instead, but that's not a solution for me. Any Ideas?

Goolgle has changed server Api's

Recaptcha has stopped working since couple days, Google has apparently changed the server urls http://code.google.com/p/web2py/issues/detail?id=255. Quick fix for now is to override the module Recaptcha with updated urls

module Recaptcha
RECAPTCHA_API_SERVER = 'http://api.recaptcha.net'
RECAPTCHA_API_SECURE_SERVER = 'https://www.google.com/recaptcha/api/'
RECAPTCHA_VERIFY_SERVER = 'https://www.google.com/recaptcha/api/verify'
end

The url's in the gem have to be updated accordingly.

Cheers
Abu

Add Error message localization

In lib/recaptcha/verify.rb you're adding error messages to the ActiveRecord's error base. Please make these messages localizable!

e.g. line 42 - verify.rb:
model.errors.add :base, options[:message] || "Oops, we failed to validate your word verification response. Please try again."
should look become
model.errors.add :base, options[:message] || t("recaptcha_not_reachable_message")

Plans on moving to gemcutter?

I'm working on a project where we use ambethia-recaptcha gem and we want to remove all gems from github 'cause the are stoping gem building and eventually gem hosting. Are there any plans to move the gem to gemcutter or rubyforge?

Please, get me posted when you make the move or any other decision.

BTW, thanks for the gem ;)

recaptcha in modal/overlay

im having a problem getting the recaptcha script to generate in my modal/overlay partial.

the script im using is
<%= recaptcha_tags :display=>{:theme=>'white', :noscript => false}%>

is what happens when i load in my overlay partial. end result is i cannot see the recaptcha

is what happens when i use the above script in a regular view. and it displays properly.

is there a work around for this?

here is the gist.

https://gist.github.com/ad2ff6371de4d6443f60

reCaptcha with Authlogic registration problem

I'm using reCaptcha with Authlogic exactly this way, but I'm experiencing a problem.

If you try to register only missing or typing wrong recaptcha it will fail and render the page again raising the recaptcha error.
But if you just click the register button again it will success register the user and tell me that is the second time I logged in in the website.
Do you know what could be hapening in my code?

def create
@user = User.create(params[:user])

respond_to do |format|
    if verify_recaptcha(@user) && @user.save
      flash[:notice] = 'Success.'
      format.html { redirect_to(@user) }
      format.xml  { render :xml => @user, :status => :created, :location => @user }
    else
      format.html { render :action => "new" }
      format.xml  { render :xml => @user.errors, :status => :unprocessable_entity }
    end
end

end

Thanks.

Use with authlogic-oid

Has anyone managed to get this working alongside authlogic-oid? It looks like there is some interference between the two in the way they are programmed (or the way authlogic assumes the create action progresses when using open id).

If anyone has managed to get it working how would I alter the following User create action so that it would work with recaptcha (I have tried various ways of inserting the verify_recaptcha method without stuffing the registration process for open id users but no luck so far).

def create
  @user = User.new(params[:user])
  @user.save do |result|
    if result
      create_flash_notice("Successfully registered",:success)
      redirect_to dashboard_url
    else
      create_flash_notice("Unable to register",:error)
      render :action => 'new'
    end
  end
end

Thread safety issue

The code used at https://github.com/ambethia/recaptcha/blob/master/lib/recaptcha.rb#L30 is not thread safe.

The with_configuration method is modifying the globaly available Recaptcha::@configuration variable; which will cause issues.

I would advise either of this two:

  • removing this functionality and only rely on inline overrides
  • or making Recaptcha.confguration and Recaptcha.with_configuration thread based; using an other immutable variable for the process defaults.

Order of validation in README would not work

Hello,

the README says:

respond_to do |format|
  if verify_recaptcha(:model => @post,
      :message => "Oh! It's error with reCAPTCHA!") && @post.save
    # ...
  else
    # ...
  end
end

Wich would NOT work.

The method verify_recaptcha would add an error to the @post, but the call to @post.save will call @post.valid?, which will clear the errors container of @post. So at the end, only the errors from @post.valid? will survive and the error added by verify_recaptche will disappear.

To solve this, one should validate the model first and then add the recaptcha errors:

respond_to do |format|
  post_valid, recaptcha_verified = @post.save,
      verify_recaptcha(:model => @post)
  if post_valid && recaptcha_verified
    # ...
  else
    # ...
  end
end

Running app on SSL requires modifying views

Switching an app using this gem to run on SSL requires modifying all the views (and, in Typo's case, all the themes you may want to use because the themes all use recaptcha directly).

It would be much better if the default value for :ssl could be set from the configuration rather than in the view.

Why does this gem need to be told whether to use SSL or not? Would it work to use '//www.google.com/recaptcha/api' as the nonssl API URL so the browser will use HTTPS when needed? If not, could it check the URL scheme of the page?

Tests not running on a clean checkout or unpacked gem

While trying to run the tests, I get the following error with ruby 1.8.7

(in /Users/schmidt/Projekte/github/recaptcha)
./test/verify_recaptcha_test.rb:2:in `require': no such file to load -- rails/version (LoadError)
  from ./test/verify_recaptcha_test.rb:2
  from /Users/schmidt/.rvm/gems/ruby-1.8.7-p248/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
  from /Users/schmidt/.rvm/gems/ruby-1.8.7-p248/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
  from /Users/schmidt/.rvm/gems/ruby-1.8.7-p248/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
  from /Users/schmidt/.rvm/gems/ruby-1.8.7-p248/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/Users/schmidt/.rvm/rubies/ruby-1.8.7-p248...]

I have rails 2.3.5 installed.

What do I need to do, to get the tests running? Should the be either simplified or publicly documented?

defined? flash ? flash[:recaptcha_error] : "" doesn't do what you think

You have this line in http://github.com/ambethia/recaptcha/blob/master/lib/recaptcha/client_helper.rb#L9

defined? is a very special beast

 ☃ /tmp$ ruby -ve 'p(defined? flash ? flash[:recaptcha_error] : "")'
 ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
 nil
 ☃ /tmp$ ruby19 -ve 'p(defined? flash ? flash[:recaptcha_error] : "")'
 ruby 1.9.2dev (2009-09-25 trunk 25091) [x86_64-darwin10.0.0]
 "expression"

or

  ☃ /tmp$ ruby -ve 'p(defined? flash &&= 3)'
   ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
   "assignment"
  ☃ /tmp$ ruby19 -ve 'p(defined? flash &&= 3)'
  ruby 1.9.2dev (2009-09-25 trunk 25091) [x86_64-darwin10.0.0]
  "assignment"

You should use defined?(flash) ? flash[:recaptcha_error] : ""

verify_recaptcha() always return false

"config/environment.rb"

ENV['RECAPTCHA_PUBLIC_KEY'] = '6LdCbtQSAAAAAL28'
ENV['RECAPTCHA_PRIVATE_KEY'] = '6LdCbtQSAAAAAP'

view:
<%= form_tag params.merge(:action=>"create") do %>


<%= text_field_tag 'telephone',nil, :id => "tel"%>

Введите код с картинки

<%= recaptcha_tags :display => {:theme => 'white'}%>



<%= submit_tag "Бронировать" %>

<% end %>
controller:
@booking = Booking.build(booking)
if verify_recaptcha()
@booking.save
respond_with(@booking)
else
redirect_to :action => "new", :parking_id => params[:booking_step]['parking_id']
end
gemfile:
gem "recaptcha", :require => "recaptcha/rails"

problem:
verify_recaptcha() always returns false. Help me find a bug in the code.
thanks for the earlier.

rake test fails

$ rake test
(in /home/tagoh/rpms/BUILDROOT/rubygem-recaptcha-0.3.1-1.fc14.x86_64/usr/lib/ruby/gems/1.8/gems/recaptcha-0.3.1)
You don't have i18n installed in your application. Please add it to your Gemfile and run bundle install
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- i18n (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/i18n.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/transliterate.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/string/inflections.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/array/conversions.rb:4
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/duration.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/time/calculations.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/string/conversions.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/string.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from ./test/verify_recaptcha_test.rb:3
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:4:in load' from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:4 from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:4:ineach'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:4
rake aborted!
Command failed with status (1): [/usr/bin/ruby -I"lib:test" "/usr/lib/ruby/...]

(See full trace by running task with --trace)

invalid-request-cookie

Continue to get this invalid-request-cookie error when attempting to submit form

Wonder if this is an issue with the reCaptcha plugin, the reCaptcha service, or an issue with rails

Verification failure

My recaptcha verification fails in production, the same code works just fine in development. I made sure the public and private keys are correct and the correct keys load in the production enviornment. My production server hostname is "server" and I generated the keys are recaptcha with that name. Where do I even begin to troubleshoot this?

In config.yml

test:
recap_pub_key: 6LcbaboSAAAAADbBxT9yLOJ7CoLWLsuAfZr-aL-H
recap_priv_key: 6LcbaboSAAAAACJMtxxfExG5dm_GcDHuZl9WVjZG
google_js_api: ABQIAAAAi_F8JNAI9__oCG-KzCfTYhTJQa0g3IQ9GZqIMmInSLzwtGDKaBQ6kTvHNGROiENaALqema6YZJEh2Q
development:
recap_pub_key: 6LcbaboSAAAAADbBxT9yLOJ7CoLWLsuAfZr-aL-H
recap_priv_key: 6LcbaboSAAAAACJMtxxfExG5dm_GcDHuZl9WVjZG
google_js_api: ABQIAAAAi_F8JNAI9__oCG-KzCfTYhTJQa0g3IQ9GZqIMmInSLzwtGDKaBQ6kTvHNGROiENaALqema6YZJEh2Q
production:
recap_pub_key: 6LcbaboSAAAAADbBxT9yLOJ7CoLWLsuAfZr-aL-H
recap_priv_key: 6LcbaboSAAAAACJMtxxfExG5dm_GcDHuZl9WVjZG
google_js_api: ABQIAAAAi_F8JNAI9__oCG-KzCfTYhTJQa0g3IQ9GZqIMmInSLzwtGDKaBQ6kTvHNGROiENaALqema6YZJEh2Q

in environment.rb
APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml")[RAILS_ENV]
ENV['RECAPTCHA_PUBLIC_KEY'] = APP_CONFIG['recap_pub_key']
ENV['RECAPTCHA_PRIVATE_KEY'] = APP_CONFIG['recap_priv_key']
ENV['GOOGLE_JS_API'] = APP_CONFIG['google_js_api']

In users_controller.rb

def create
@user = User.new(params[:user])
@user.role = Role.find_by_name('user')
v = verify_recaptcha(:model => @user, :message => "Text entered did not match the image!")
if v
if @user.save_without_session_maintenance
@user.send_later :deliver_activation_instructions!
flash[:notice] = t('users.create.confirmation')

redirect_back_or_default root_url

            redirect_to root_url
        else
            render :action => :new
        end
    else

@user.errors.add()

flash[:error] = "Text entered did not match the image"

        render :action => :new
    end
end
# in production.log

Recaptcha result - false

<User id: nil, email: "[email protected]", zip: "88888", processing_vote: false, cached_slug: nil, username: "user1", sex: 0, age: 29, lat: nil,

lng: nil, role_id: 2, posts_count: 0, active: nil, created_at: nil, updated_at: nil, crypted_password: "2754e9333463856a1aaa4a91e5616323866e8833fafc
54e3029...", password_salt: "pdQQJpXxzqHJyNXjYO_M", persistence_token: "7bd973e319a175a7048680850a552667f668ee859b9af137a16...", single_access_token:
"muJOtrpdTXPJ6cQWtZs3", perishable_token: nil, login_count: 0, failed_login_count: 0, last_request_at: nil, current_login_at: nil, last_login_at: ni
l, current_login_ip: nil, last_login_ip: nil, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil, processing:
true>
Errors for this registration

<ActiveRecord::Errors:0xb2d1044 @base=#<User id: nil, email: "[email protected]", zip: "94131", processing_post: false, cached_slug: nil, userna

me: "user1", sex: 0, age: 29, lat: nil, lng: nil, role_id: 2, posts_count: 0, active: nil, created_at: nil, updated_at: nil, crypted_password: "2754e
9333463856a1aaa4a91e5616323866e8833fafc54e3029...", password_salt: "pdQQJpXxzqHJyNXjYO_M", persistence_token: "7bd973e319a175a7048680850a552667f668ee
859b9af137a16...", single_access_token: "muJOtrpdTXPJ6cQWtZs3", perishable_token: nil, login_count: 0, failed_login_count: 0, last_request_at: nil, c
urrent_login_at: nil, last_login_at: nil, current_login_ip: nil, last_login_ip: nil, image_file_name: nil, image_content_type: nil, image_file_size:
nil, image_updated_at: nil, processing: true>, @errors=#<OrderedHash {"base"=>[#<ActiveRecord::Error:0xb0b7c54 @base=#<User id: nil, email: "[email protected]", zip: "88888", processing_vote: false, cached_slug: nil, username: "user1", sex: 0, age: 29, lat: nil, lng: nil, role_id: 2, posts_cou
nt: 0, active: nil, created_at: nil, updated_at: nil, crypted_password: "2754e9333463856a1aaa4a91e5616323866e8833fafc54e3029...", password_salt: "pdQ
QJpXxzqHJyNXjYO_M", persistence_token: "7bd973e319a175a7048680850a552667f668ee859b9af137a16...", single_access_token: "muJOtrpdTXPJ6cQWtZs3", perisha
ble_token: nil, login_count: 0, failed_login_count: 0, last_request_at: nil, current_login_at: nil, last_login_at: nil, current_login_ip: nil, last_l
ogin_ip: nil, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil, processing: true>, @Attribute=:base, @messa
ge="Text entered did not match the image!", @type="Text entered did not match the image!", @options={}>]}>>

rails edge issue

ActionView::TemplateError (uninitialized constant Ambethia::ReCaptcha::Helper::Builder) when using recaptcha_tags

it narrows down to this line in recaptcha.rb

xhtml = Builder::XmlMarkup.new :target => out=(''), :indent => 2 # Because I can.

Always wrong recaptcha

I'm trying to set up Recaptcha in my rails 3.1 app. After I install gem and set up my public and private keys in a config/initializers/recaptcha.rb

   Recaptcha.configure do |config|
        config.public_key  = '6Ldo....'
         config.private_key = '6Ldo.....'
    end

I use it like this:

       <%= f.buttons do %>
        <%= recaptcha_tags %> 
            <%= f.commit_button %>
       <% end %>

controller where I need to check the recaptcha I use verify_recaptcha. And no matter what, 'verify_recaptcha' returns false and so the form posting doesn't succeed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.