Class: TaoForm::Components::FormComponent
- Inherits:
-
TaoOnRails::Components::Base
- Object
- TaoOnRails::Components::Base
- TaoForm::Components::FormComponent
- Defined in:
- lib/tao_form/components/form_component.rb
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, record, options = {}) ⇒ FormComponent
constructor
A new instance of FormComponent.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view, record, options = {}) ⇒ FormComponent
Returns a new instance of FormComponent.
7 8 9 10 11 |
# File 'lib/tao_form/components/form_component.rb', line 7 def initialize view, record, = {} super view, @record = record = (, .delete(:html) || {}) end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
5 6 7 |
# File 'lib/tao_form/components/form_component.rb', line 5 def end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'lib/tao_form/components/form_component.rb', line 5 def record @record end |
Class Method Details
.component_name ⇒ Object
21 22 23 |
# File 'lib/tao_form/components/form_component.rb', line 21 def self.component_name :form end |
Instance Method Details
#render(&block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/tao_form/components/form_component.rb', line 13 def render &block if block_given? view.content_tag tag_name, view.simple_form_for(record, , &block), else super end end |