Skip to content

Commit

Permalink
Use option[:error_msg] for verify_recaptcha, so we can translate the …
Browse files Browse the repository at this point in the history
…error message
  • Loading branch information
gaizka committed Nov 11, 2008
1 parent 6904f0b commit 2414877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/recaptcha.rb
Expand Up @@ -61,7 +61,8 @@ def verify_recaptcha(model = nil, options = {})
unless answer == 'true'
session[:recaptcha_error] = error
model.valid? if model
model.errors.add_to_base "Captcha response is incorrect, please try again." if model
error_msg = options[:error_msg] ||= "Captcha response is incorrect, please try again."
model.errors.add_to_base error_msg if model
return false
else
session[:recaptcha_error] = nil
Expand Down

0 comments on commit 2414877

Please sign in to comment.