Class: SimpleBootstrapForm::HorizontalForm::Fields::BaseField

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_bootstrap_form/horizontal_form/fields/base_field.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(form_builder, template, name, options) ⇒ BaseField

Returns a new instance of BaseField.



10
11
12
13
14
15
# File 'lib/simple_bootstrap_form/horizontal_form/fields/base_field.rb', line 10

def initialize(form_builder, template, name, options)
  @form_builder = form_builder
  @template = template
  @name = name
  process_options(options)
end

Class Attribute Details

.typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/simple_bootstrap_form/horizontal_form/fields/base_field.rb', line 7

def type
  @type
end

Instance Method Details

#to_sObject



17
18
19
20
21
22
23
# File 'lib/simple_bootstrap_form/horizontal_form/fields/base_field.rb', line 17

def to_s
@template. :div, group_options do
    field_label +
    input_tag +
    errors_block
  end
end