Module: ReCaptcha::Helpers

Defined in:
lib/re_captcha/helpers.rb

Instance Method Summary collapse

Instance Method Details

#recaptcha_script(language: nil) ⇒ Object



10
11
12
13
14
# File 'lib/re_captcha/helpers.rb', line 10

def recaptcha_script(language: nil)
  html = ''
  html << %(<script src="#{ReCaptcha.client.api_endpoint}api.js#{language_query(language)}" async defer></script>\n)
  format_html(html)
end

#recaptcha_tags(options = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/re_captcha/helpers.rb', line 3

def recaptcha_tags(options = {})
  html = ''
  html << %(<div class="g-recaptcha" data-sitekey="#{ReCaptcha.client.public_key}" )
  html << %(data-stoken="#{secure_token}" #{tag_attributes(options)}></div>\n)
  format_html(html)
end