Rails 3: Do we work Mongoid captcha exists?

I tried several captchas for Rails 3 and nobody plays well with Mongoid. I do not need something too fantastic to just quickly check a person.

How do you guys work with Mongoid? Are there any alternative solutions?

+4
source share
2 answers

This is the outer area of ​​mangoids, but still applicable. See Negative Captcha :

Negative captchas create a form in which there are tasks that only bots can perform, but people cannot. This has the same effect in which (at least) the false positive identification rate is significantly lower compared to positive captcha. All this happens, without forcing people to go through any additional troubles in order to submit the form. It is truly a win-win.

+2
source

You can use simple-captcha v1rtual branch with mongo support. Simple and clean setup and use:

Just add to your gemfile as:

gem 'wolcanus-simple_captcha', :require => 'simple_captcha', :git => 'git://github.com/v1rtual/simple-captcha.git' 

Run the generator:

 rails generate simple_captcha 

For Controller Based, add the following line to the file "app / controllers / application.rb":

 ApplicationController < ActionController::Base include SimpleCaptcha::ControllerHelpers end 

In the view file in the form tag, add this code:

 <%= show_simple_captcha %> 

and in the action of the controllers authenticate it as

 if simple_captcha_valid? do this else do that end 

Refer to the thread for additional options: https://github.com/v1rtual/simple-captcha

0
source

All Articles