Class: Hanami::Helpers::FormHelper::HtmlNode Private

Inherits:
HtmlHelper::HtmlNode show all
Defined in:
lib/hanami/helpers/form_helper/html_node.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

HTML form node

See Also:

Since:

  • 0.2.0

Constant Summary

Constants inherited from HtmlHelper::EmptyHtmlNode

HtmlHelper::EmptyHtmlNode::ATTRIBUTES_SEPARATOR, HtmlHelper::EmptyHtmlNode::BOOLEAN_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from HtmlHelper::HtmlNode

#to_s

Methods inherited from HtmlHelper::EmptyHtmlNode

#to_s

Constructor Details

#initialize(name, content, attributes, options) ⇒ Hanami::Helpers::FormHelper::HtmlNode

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a new HTML form node

Parameters:

  • name (Symbol, String)

    the name of the tag

  • content (String, Proc, Hanami::Helpers::HtmlHelper::FormBuilder, NilClass)

    the optional content

  • attributes (Hash, NilClass)

    the optional tag attributes

  • options (Hash)

    a set of data

Since:

  • 0.2.0



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/hanami/helpers/form_helper/html_node.rb', line 24

def initialize(name, content, attributes, options)
  super

  @verb       = options.fetch(:verb,       nil)
  @csrf_token = options.fetch(:csrf_token, nil)

  @builder = FormBuilder.new(
    options.fetch(:name),
    options.fetch(:values)
  )
end