Skip to content

Commit

Permalink
Added parameter :message => 'Custom error message' for verify_recaptc…
Browse files Browse the repository at this point in the history
…ha method.
  • Loading branch information
introkun committed May 26, 2009
1 parent 28a5f37 commit c205b8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/recaptcha.rb
Expand Up @@ -67,9 +67,9 @@ def verify_recaptcha(options = {})
if model
model.valid?
if Rails::VERSION::MAJOR == 2 and Rails::VERSION::MINOR >= 2
model.errors.add_to_base I18n.translate("#{model.class.name.underscore}.captcha", :scope => %w(activerecord errors models), :default => "Captcha response is incorrect, please try again.")
model.errors.add_to_base I18n.translate("#{model.class.name.underscore}.captcha", :scope => %w(activerecord errors models), :default => options[:message] ||= "Captcha response is incorrect, please try again.")
else
model.errors.add_to_base "Captcha response is incorrect, please try again."
model.errors.add_to_base options[:message] ||= "Captcha response is incorrect, please try again."
end
end
return false
Expand Down

0 comments on commit c205b8c

Please sign in to comment.