Class: SimpleBootstrapForm::Fields::BaseField

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_bootstrap_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.



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

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

Class Attribute Details

.typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_sObject



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

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