Class: SimpleBootstrapForm::HorizontalForm::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- SimpleBootstrapForm::HorizontalForm::FormBuilder
- Defined in:
- lib/simple_bootstrap_form/horizontal_form/form_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object_name, object, template, options = {}) ⇒ FormBuilder
constructor
A new instance of FormBuilder.
- #input(name, supplied_options = {}) ⇒ Object
Constructor Details
#initialize(object_name, object, template, options = {}) ⇒ FormBuilder
Returns a new instance of FormBuilder.
5 6 7 8 9 |
# File 'lib/simple_bootstrap_form/horizontal_form/form_builder.rb', line 5 def initialize(object_name, object, template, ={}) @field_factory = FieldFactory.new self, template super object_name, object, template, end |
Class Method Details
.fully_qualified_class_name_for_field(field_class_name) ⇒ Object
16 17 18 19 |
# File 'lib/simple_bootstrap_form/horizontal_form/form_builder.rb', line 16 def self.fully_qualified_class_name_for_field(field_class_name) # Better to do this manually than using introspection "SimpleBootstrapForm::HorizontalForm::Fields::#{field_class_name}" end |
Instance Method Details
#input(name, supplied_options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/simple_bootstrap_form/horizontal_form/form_builder.rb', line 11 def input(name, = {}) = () @field_factory.for_attribute(name, ).to_s end |