Module: Captchator::View
- Included in:
- ActionView::Base
- Defined in:
- lib/captchator/view.rb
Instance Method Summary collapse
- #captchator_image ⇒ Object
- #captchator_image_path ⇒ Object
- #captchator_input ⇒ Object
- #captchator_instructions ⇒ Object
- #captchator_label ⇒ Object
- #captchator_refresh ⇒ Object
- #captchator_tags ⇒ Object
Instance Method Details
#captchator_image ⇒ Object
| 34 35 36 37 38 | # File 'lib/captchator/view.rb', line 34 def captchator_image "<img src=\"\#{captchator_image_path}\" id=\"captchator_image\" />\n" end | 
#captchator_image_path ⇒ Object
| 30 31 32 | # File 'lib/captchator/view.rb', line 30 def captchator_image_path File.join("http://captchator.com/captcha/image", captchator_session_id) end | 
#captchator_input ⇒ Object
| 15 16 17 | # File 'lib/captchator/view.rb', line 15 def captchator_input text_field_tag(:captchator_answer) end | 
#captchator_instructions ⇒ Object
| 3 4 5 | # File 'lib/captchator/view.rb', line 3 def captchator_instructions ENV['captchator_instructions'] || "Please write the text shown in the captcha box to prove you're not a machine." end | 
#captchator_label ⇒ Object
| 11 12 13 | # File 'lib/captchator/view.rb', line 11 def captchator_label label_tag('captchator_answer', captchator_image) end | 
#captchator_refresh ⇒ Object
| 19 20 21 22 23 24 25 26 27 28 | # File 'lib/captchator/view.rb', line 19 def captchator_refresh link_to("refresh captcha", {:anchor => 'captchaptor_image'}, { :id => 'captchator_refresh', :onclick => "var new_url = \"\#{captchator_image_path}?\" + (new Date).getTime();\n$('#captchator_image').attr('src', new_url);\nreturn false;\n JAVASCRIPT\n })\nend\n" | 
#captchator_tags ⇒ Object
| 7 8 9 | # File 'lib/captchator/view.rb', line 7 def captchator_label + captchator_input + captchator_refresh end |