Module: ActionView::Helpers::NegativeCaptchaHelpers
- Defined in:
- lib/negative_captcha/view_helpers.rb
Instance Method Summary collapse
- #negative_captcha(captcha) ⇒ Object
- #negative_check_box_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_email_field_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_file_field_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_hidden_field_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_label_tag(negative_captcha, field, name, options = {}, &block) ⇒ Object
- #negative_password_field_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_text_area_tag(negative_captcha, field, options = {}) ⇒ Object
- #negative_text_field_tag(negative_captcha, field, options = {}) ⇒ Object
Instance Method Details
#negative_captcha(captcha) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/negative_captcha/view_helpers.rb', line 4 def negative_captcha(captcha) [ hidden_field_tag('timestamp', captcha.), hidden_field_tag('spinner', captcha.spinner), ].join.html_safe end |
#negative_check_box_tag(negative_captcha, field, options = {}) ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/negative_captcha/view_helpers.rb', line 65 def negative_check_box_tag(negative_captcha, field, ={}) check_box_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => negative_captcha.css) do check_box_tag(field, '', :tabindex => '999') end end |
#negative_email_field_tag(negative_captcha, field, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/negative_captcha/view_helpers.rb', line 22 def negative_email_field_tag(negative_captcha, field, ={}) email_field_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => 'position: absolute; left: -2000px;') do email_field_tag(field, '', :tabindex => '999', :autocomplete => 'off') end.html_safe end |
#negative_file_field_tag(negative_captcha, field, options = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/negative_captcha/view_helpers.rb', line 55 def negative_file_field_tag(negative_captcha, field, ={}) file_field_tag( negative_captcha.fields[field], .merge(:value => negative_captcha.values[field]) ) + content_tag('div', :style => negative_captcha.css) do file_field_tag(field, :tabindex => '999') end end |
#negative_hidden_field_tag(negative_captcha, field, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/negative_captcha/view_helpers.rb', line 44 def negative_hidden_field_tag(negative_captcha, field, ={}) hidden_field_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => negative_captcha.css) do hidden_field_tag(field, '', :tabindex => '999') end.html_safe end |
#negative_label_tag(negative_captcha, field, name, options = {}, &block) ⇒ Object
87 88 89 |
# File 'lib/negative_captcha/view_helpers.rb', line 87 def negative_label_tag(negative_captcha, field, name, ={}, &block) label_tag(negative_captcha.fields[field], name, , &block) end |
#negative_password_field_tag(negative_captcha, field, options = {}) ⇒ Object
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/negative_captcha/view_helpers.rb', line 76 def negative_password_field_tag(negative_captcha, field, ={}) password_field_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => negative_captcha.css) do password_field_tag(field, '', :tabindex => '999') end.html_safe end |
#negative_text_area_tag(negative_captcha, field, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/negative_captcha/view_helpers.rb', line 33 def negative_text_area_tag(negative_captcha, field, ={}) text_area_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => negative_captcha.css) do text_area_tag(field, '', :tabindex => '999', :autocomplete => 'off') end.html_safe end |
#negative_text_field_tag(negative_captcha, field, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/negative_captcha/view_helpers.rb', line 11 def negative_text_field_tag(negative_captcha, field, ={}) text_field_tag( negative_captcha.fields[field], negative_captcha.values[field], ) + content_tag('div', :style => negative_captcha.css) do text_field_tag(field, '', :tabindex => '999', :autocomplete => 'off') end.html_safe end |