Class: SimpleForm::ActionViewExtensions::BuilderBase

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_form/action_view_extensions/builder.rb

Overview

Base builder to handle each instance of a collection of radio buttons / check boxes. Based on (at this time upcoming) Rails 4 collection builders.

Direct Known Subclasses

CheckBoxBuilder, RadioButtonBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(form_builder, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ BuilderBase

Returns a new instance of BuilderBase.



8
9
10
11
12
13
14
15
16
17
# File 'lib/simple_form/action_view_extensions/builder.rb', line 8

def initialize(form_builder, method_name, object, sanitized_attribute_name, text,
               value, input_html_options)
  @form_builder = form_builder
  @method_name = method_name
  @object = object
  @sanitized_attribute_name = sanitized_attribute_name
  @text = text
  @value = value
  @input_html_options = input_html_options
end

Instance Attribute Details

#objectObject (readonly)

:nodoc:



6
7
8
# File 'lib/simple_form/action_view_extensions/builder.rb', line 6

def object
  @object
end

#textObject (readonly)

:nodoc:



6
7
8
# File 'lib/simple_form/action_view_extensions/builder.rb', line 6

def text
  @text
end

#valueObject (readonly)

:nodoc:



6
7
8
# File 'lib/simple_form/action_view_extensions/builder.rb', line 6

def value
  @value
end

Instance Method Details

#label(label_html_options = {}, &block) ⇒ Object



19
20
21
# File 'lib/simple_form/action_view_extensions/builder.rb', line 19

def label(label_html_options={}, &block)
  @form_builder.label(@sanitized_attribute_name, @text, label_html_options, &block)
end