Class: SimpleBootstrapForm::HorizontalForm::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
lib/simple_bootstrap_form/horizontal_form/form_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

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, options={})
  @field_factory = FieldFactory.new self, template
  process_options options
  super object_name, object, template, options_for_rails_form_builder
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, supplied_options = {})
  options = field_options(supplied_options)
  @field_factory.for_attribute(name, options).to_s
end