zendesk / kamcaptcha

A captcha plugin for Rails
Apache License 2.0
63 stars 12 forks source link

Rails 2.3.3 issues #1

Closed mukundmr closed 11 years ago

mukundmr commented 15 years ago

I get a undefined captcha_block when I use it after installation. I had to specify the helper in the plugin init.rb as below to address this.


$:.unshift "#{File.dirname(**FILE**)}/lib"

require 'captcha_util'
require 'captcha_helper'
require 'validates_captcha'

ActionController::Base.class_eval do
  include ValidatesCaptcha
  helper CaptchaHelper
end

Also, installation tends to fail with the following message. environment.rb doesn't get updated, but the plugin works.

ruby script/plugin install git://github.com/zendesk/captcha.git


$ ruby script/plugin install git://github.com/zendesk/captcha.git
Initialized empty Git repository in /xxx/vendor/plugins/captcha/.git/
remote: Counting objects: 16, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 16 (delta 3), reused 3 (delta 0)
Unpacking objects: 100% (16/16), done.
From git://github.com/zendesk/captcha
 * branch            HEAD       -> FETCH_HEAD
Adding CAPTCHA_SALT global variable to environment.rb
Plugin not found: ["git://github.com/zendesk/captcha.git"]
nshbrown commented 13 years ago

Thanks @mukundmr. The helper line on the ActionController fix the bug I ran into.