Recaptcha (or other captchas)

Neil Cauldwell wrote:

Does anyone have any suggestions for a best practice implementation of Recaptcha (or other captchas - if you recommend going another route, I'm all ears)? I've found the recaptcha gem and a plugin but I don't know which is the best implementation, and I haven't found a thorough tutorial plus example code for either.

Thanks

No ideas?

I have implemented Recaptcha on the registration page of this site: http://www.satechevents.co.za/account/register

I am using the gem here: http://www.loonsoft.com/recaptcha/

Schalk

Neil Cauldwell wrote:

Schalk Neethling wrote:

I have implemented Recaptcha on the registration page of this site: http://www.satechevents.co.za/account/register

I am using the gem here: http://www.loonsoft.com/recaptcha/

Schalk

Thanks, Schalk. I liked the idea of the plugin (I prefer plugins because I can jump right in to the code on which the app is dependent) but the gem seemed easy enough. However, I've followed the instructions and I'm stuck on this;

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:278:in `load_missing_constant': uninitialized constant RecaptchaClient (NameError)

How are you including the gem? I created an initializer (recaptcha_credentials.rb) with this inside;

RecaptchaClient.new(:rcc_pub=>'my_code', :rcc_priv=>'my_code')

...because I thought it was best to keep the environment.rb free of these things. I've tried putting it in the environment.rb, but that just breaks, too (same error). Where am I going wrong?! Mongrel loads if I don't include the RecaptchaClient.new.

Also, I saw this when I was installing the gem;

WARNING: RubyGems 1.2+ index not found for:   http://www.loonsoft.com/recaptcha/pkg/

RubyGems will revert to legacy indexes degrading performance. Successfully installed recaptcha-0.1.49 1 gem installed Installing ri documentation for recaptcha-0.1.49... Installing RDoc documentation for recaptcha-0.1.49...

Cheers

Schalk Neethling wrote:

I have implemented Recaptcha on the registration page of this site: http://www.satechevents.co.za/account/register

I am using the gem here: http://www.loonsoft.com/recaptcha/

Schalk

Thanks, Schalk. I liked the idea of the plugin (I prefer plugins
because I can jump right in to the code on which the app is dependent) but the gem seemed easy enough. However, I've followed the instructions and
I'm stuck on this;

I used that gem once. I ended up requiring the gem from an initializer
and reopening this class:

module ReCaptcha    module AppHelper      RCC_PUB = 'your key here'      RCC_PRIV = 'your key here'    end end

which seemed to work. I vaguely recall the setup instructions being a
bit out of date

Fred

Frederick Cheung wrote:

Thanks, Schalk. I liked the idea of the plugin (I prefer plugins because I can jump right in to the code on which the app is dependent) but
the gem seemed easy enough. However, I've followed the instructions and I'm stuck on this;

I used that gem once. I ended up requiring the gem from an
initializer and reopening this class:

module ReCaptcha   module AppHelper     RCC_PUB = 'your key here'     RCC_PRIV = 'your key here'   end end

which seemed to work. I vaguely recall the setup instructions being a bit out of date

Fred

Thanks Fred. Since the last post I've moved to the plugin, however,
I'm struggling with that one, too. It should be insanely simple; I just
need to set the public and private keys as variables in the environment.rb (or an initializer, if applicable) - but I just can't get it to work;

http://pastie.org/284245

If you're going that way you need to set ENV['RECAPTCHA_PUBLIC_KEY'],
which is not the same thing as RECAPTCHA_PUBLIC_KEY

Fred

Frederick Cheung wrote:

And should I be using any specs for recaptcha? I struggled to find much through a Googling...

The best is always hard to define depending on personal opinion which
is extremely variant from one to another. Choose something you
yourself feels comfortable with and then go through the documentation
and install. I've seen that ReCAPTCHA can be used with Ruby on Rails
and trying "Recaptcha Ruby Rails" into google got me this result: Dead Programmer Society: Recaptcha On Rails   which seems fairly detailed.

Ryan Bigg wrote:

The best is always hard to define depending on personal opinion which is extremely variant from one to another. Choose something you yourself feels comfortable with and then go through the documentation and install. I've seen that ReCAPTCHA can be used with Ruby on Rails and trying "Recaptcha Ruby Rails" into google got me this result: http://deadprogrammersociety.blogspot.com/2008/02/recaptcha-on-rails.html   which seems fairly detailed. ----- Ryan Bigg Freelancer http://frozenplague.net

Thanks Ryan. That tutorial looks handy. I managed to implement the plugin in the same way that hte tutorial describes (if only I had had it at the time). I've seen very little on the spec/test front on integrating recaptcha. Maybe it's not so important, then?