Class: Phlexi::Form::Components::Wrapper

Inherits:
Base
  • Object
show all
Defined in:
lib/phlexi/form/components/wrapper.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #field

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Phlexi::Form::Components::Base

Instance Attribute Details

#inner_attributesObject (readonly)

Returns the value of attribute inner_attributes.



7
8
9
# File 'lib/phlexi/form/components/wrapper.rb', line 7

def inner_attributes
  @inner_attributes
end

Instance Method Details

#view_templateObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/phlexi/form/components/wrapper.rb', line 9

def view_template
  div(**attributes) do
    render field.label_tag
    div(**inner_attributes) do
      yield field if block_given?
      render field.full_error_tag
      render field.hint_tag
    end
  end
end