Class: RailsBootstrapForm::BootstrapFormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Includes:
FieldWrapperBuilder, Helpers, InputGroupBuilder, Inputs
Defined in:
lib/rails_bootstrap_form/bootstrap_form_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object_name, object, template, options) ⇒ BootstrapFormBuilder

Returns a new instance of BootstrapFormBuilder.



20
21
22
23
24
25
# File 'lib/rails_bootstrap_form/bootstrap_form_builder.rb', line 20

def initialize(object_name, object, template, options)
  @bootstrap_form_options = RailsBootstrapForm::BootstrapFormOptions.new(options[:bootstrap])
  apply_default_form_options(options)
  apply_default_form_classes(options)
  super(object_name, object, template, options)
end

Instance Attribute Details

#bootstrap_form_optionsObject

Returns the value of attribute bootstrap_form_options.



18
19
20
# File 'lib/rails_bootstrap_form/bootstrap_form_builder.rb', line 18

def bootstrap_form_options
  @bootstrap_form_options
end

Instance Method Details

#fields_for(record_name, record_object = nil, fields_options = {}, &block) ⇒ Object



27
28
29
30
31
# File 'lib/rails_bootstrap_form/bootstrap_form_builder.rb', line 27

def fields_for(record_name, record_object = nil, fields_options = {}, &block)
  fields_options = fields_for_options(record_object, fields_options)
  record_object = nil if record_object.is_a?(Hash) && record_object.extractable_options?
  super(record_name, record_object, fields_options, &block)
end