What captcha system to use in Ruby on Rails3? [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question 开发者_如何学运维I am using Ruby on Rails 3.0.7 and I would like to add captcha to my forms.
What do you advice? What is "the best" and the most widely used captcha system for Ruby on Rails applications? Where I can find some good documentation?
Personally I'm not a fan of recaptcha, simply because I find the text so hard to read - even though it's for a good cause etc..
Have you considered doing something like asking a simple question instead (what is 4 plus 2), or another good one I've seen is a jquery slider that you have to move to prove you're human.
If you do want to stick with a captcha system, also check out Recommendations for a captcha on Ruby on Rails
I used rack-recaptcha which is a great gem and it is very easy to use, you can find the doc at github but it is pretty simple:
Gemfile:
gem 'rack-recaptcha', :require => 'rack/recaptcha'
Application.rb:
class Application < Rails::Application
# ...
config.gem 'rack-recaptcha', :lib => 'rack/recaptcha'
config.middleware.use Rack::Recaptcha, :public_key => 'KEY', :private_key => 'SECRET'
end
NOTE: You can get your public and private keys in the recaptcha page
Application_helper.rb or whatever helper you want it in.
module ApplicationHelper
include Rack::Recaptcha::Helpers
end
Application_controller.rb or whatever controller you want it in.
module ApplicationController
include Rack::Recaptcha::Helpers
end
That is all the setup that you will need for it to work. It also has a test mode, simply add Rack::Recaptcha.test_mode! :return => false
to your spec helper.
I really encourage you to check the full doc.
Hope it works for you :)
Please visit the link https://github.com/galetahub/simple-captcha will describe more about simple-captcha
I have used recaptcha in a RoR project and it is working fine in production without any issues. I would recommend that.
For a list of available options, look here
Don't know much about Ruby on rails but I know ReCpatcha is most easiest and it's ran by google so you know it's good haha
found a link http://ambethia.com/recaptcha/
精彩评论