Class: Felt::InputGroup::Wrapper

Inherits:
Base
  • Object
show all
Defined in:
lib/input_group/wrapper.rb

Overview

Encapsulates the common functionality of all input groups.

Renders a wrapping div containing a label, a hint, an input field, a help element, and a list of errors.

Pass the input field as a block to the constructor.

Instance Attribute Summary collapse

Attributes inherited from Base

#attribute, #form, #input_options, #options

Instance Method Summary collapse

Methods inherited from Base

#classes, #error_classes, #errors, #errors?, #help, #help?, #help_classes, #hint, #hint?, #hint_classes, #input_classes, #label, #label?, #label_classes, #placeholder, #placeholder?

Constructor Details

#initialize(config_key: nil, **args) ⇒ Wrapper

Returns a new instance of Wrapper.



16
17
18
19
# File 'lib/input_group/wrapper.rb', line 16

def initialize(config_key: nil, **args)
  @config_key = config_key
  super(**args)
end

Instance Attribute Details

#config_keyObject (readonly)

Returns the value of attribute config_key.



14
15
16
# File 'lib/input_group/wrapper.rb', line 14

def config_key
  @config_key
end