Compare commits

...

4 Commits

Author SHA1 Message Date
d05f1b25ac Bump version to 0.1.2 2015-10-19 10:36:42 +02:00
04e016c188 Use Time.now.nsec for text field id
The text field id has to be unique for when you want two different
captchas on the same page.
2015-10-19 10:35:21 +02:00
d07827595a Bump version 0.1.1 2015-04-07 15:27:45 +02:00
12fbd8f4af Require 'rmagick' instead of 'RMagick' 2015-04-07 15:27:07 +02:00
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
require 'RMagick'
require 'rmagick'
require 'base64'
module ReallySimpleCaptcha::Captcha
@ -44,7 +44,7 @@ module ReallySimpleCaptcha::Captcha
content_tag :div, class: 'plain_captcha' do
html = image_tag "data:image/gif;base64,#{image}", alt: "Captcha"
html.concat text_field_tag PlainCaptcha.field_name, nil, required: 'required', autocomplete: 'off'
html.concat text_field_tag PlainCaptcha.field_name, nil, id: "reverse_captcha_#{Time.now.nsec}", required: 'required', autocomplete: 'off'
html
end

View File

@ -11,7 +11,7 @@ module ReallySimpleCaptcha::Captcha
module ViewHelpers
def reverse_captcha_tag
content_tag :div, text_field_tag(ReverseCaptcha.field_name), class: 'reverse_captcha', style: 'display: none'
content_tag :div, text_field_tag(ReverseCaptcha.field_name, nil, id: "reverse_captcha_#{Time.now.nsec}"), class: 'reverse_captcha', style: 'display: none'
end
end

View File

@ -1,3 +1,3 @@
module ReallySimpleCaptcha
VERSION = "0.1.0"
VERSION = "0.1.2"
end