Skip to content

routes loading order problem when activate update captcha by ajax

Xuhao edited this page Jul 31, 2013 · 1 revision

When you activate update captcha by ajax like this:

captcha_tag image_html{ update: true }

You can click captcha image or update link to get a new captcha, this will trigger a request. If you get template missing error or some others, maybe it's because your application routes override the JikeCaptcha engine route. You can try to fix it like this:

Redefine it at top of your application routes file:

# config/routes.rb
MyApp::Application.routes.draw do
  get '/jike_captcha/get_captcha', to: Jike::Captcha::GetCaptchaController.action(:index)

  # your routes
end