im trying redirect_to :back after the captcha is valid, but i think its
going back in history. so basically i need to find a way to recapture
the url that called the check captcha function.
redirect_to :back should do exactly what you need - it works on
in http referef header, so it should go back to the page which
originated the request.
From the source:
redirect_to(request.env["HTTP_REFERER"]) : raise(RedirectBackError)