Use tag helper generate captcha img for avoid CDN prefix on image_tag. #73

Add onclick event for captcha img, to click refresh #61
This commit is contained in:
Jason Lee 2019-03-07 10:29:08 +08:00
parent 3d4198fd48
commit 63b40be6f2
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,9 @@ module RuCaptcha
def rucaptcha_image_tag(opts = {})
opts[:class] = opts[:class] || 'rucaptcha-image'
image_tag(ru_captcha.root_path, opts)
opts[:src] = ru_captcha.root_path
opts[:onclick] = "this.src = '#{ru_captcha.root_path}?t=' + Date.now();"
tag(:img, opts)
end
end
end