Rack::Recaptcha::Helpers recaptcha_valid? exceptions with rails 2.3.8
Closed this issue · 1 comments
ionous commented
i'm new to rails, rack, ruby, and git/hub - so this could be user error.
within my rails controller i tried to use recaptcha_valid? but got an exception that 'env' was unknown. at the point i wanted to use it -- 'env' wasn't in the current scope, but.. after some reading up on rails on rack... 'env' does seem to live in the 'request'.
here's the change i made that seems to work, if i can figure out how to clone,branch,etc :) i will see if i can put a patch together.
def recaptcha_valid?
return env['recaptcha.valid'] if defined? env
# when a rails controller is processing, the env needs to be pulled from request
return request.env['recaptcha.valid'] if defined? request and defined? request.env
end