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:
parent
3d4198fd48
commit
63b40be6f2
|
@ -13,7 +13,9 @@ module RuCaptcha
|
||||||
|
|
||||||
def rucaptcha_image_tag(opts = {})
|
def rucaptcha_image_tag(opts = {})
|
||||||
opts[:class] = opts[:class] || 'rucaptcha-image'
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue