l have model called User
class User < ActiveRecord::Base
<%= show_simple_captcha(:object=>"user") %>
@user = User.fiind(params[:id])
First, it seems to me that a model is not where a captcha might want
to go. I personally feel it should be in the controller and view, but
not in the model.
That said, I have a helper method (well, once I refactor it out into a
method) which generates the captcha (for the view) and a simple
function which validates it and returns either :success, :failure, or
nil. :success means it matched. :failure means it did not. nil
means it could not perform the check, either because it could not
reach the servers or some internal error to my code. I treat this as
:success and move on.