erases params when user fails the spam question

1 view
Skip to first unread message

tommy

unread,
Mar 10, 2008, 1:14:17 AM3/10/08
to BrainBuster Discussion
Hey guys,
I'm using the brain buster on my site. It's been great in blocking
spam. I could see the attempts in the logs.

But it's bad for users because if a user fails it, it erases the form!

An example on:
http://jobgrades.com/company_review/show/57

Try submit a comment and fail the spam question, it erases the
message!

In my controller, i have:
before_filter :create_brain_buster, :only => [:new, :show]
before_filter :validate_brain_buster, :only =>
[:create, :create_comment]

Any ideas how I can debug this problem?

Thanks.

Rob Sanheim

unread,
Mar 16, 2008, 10:12:02 PM3/16/08
to brainbust...@googlegroups.com

Hiya

You can override the #render_or_redirect_for_captcha_failure method to
populate the form before the user is sent to back to the new or show
form. Something like this:

def render_or_redirect_for_captcha_failure
@user = Job.new(params[:job]) # your model object here! it
should match the template you are about to render
@captcha = find_brain_buster
render :action => "new"
end

HTH,
Rob

http://robsanheim.com
http://thinkrelevance.com

Reply all
Reply to author
Forward
0 new messages