Class: Katalyst::GoogleApis::FormBuilder::RecaptchaField

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/katalyst/google_apis/form_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(object_name, attribute, site_key:, **html_attributes) ⇒ RecaptchaField

Returns a new instance of RecaptchaField.



22
23
24
25
26
27
# File 'app/helpers/katalyst/google_apis/form_builder.rb', line 22

def initialize(object_name, attribute, site_key:, **html_attributes)
  @object_name     = object_name
  @attribute       = attribute
  @site_key        = site_key
  @html_attributes = html_attributes
end

Instance Method Details

#render(template) ⇒ Object



29
30
31
32
# File 'app/helpers/katalyst/google_apis/form_builder.rb', line 29

def render(template)
  template.safe_join([template.tag.div(**@html_attributes, data:),
                      template.hidden_field(@object_name, @attribute)])
end