Class: SimpleFormWithClientValidation::ActionViewExtensions::BuilderBase
- Inherits:
-
Object
- Object
- SimpleFormWithClientValidation::ActionViewExtensions::BuilderBase
- Defined in:
- lib/simple_form_with_client_validation/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
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
:nodoc:.
-
#text ⇒ Object
readonly
:nodoc:.
-
#value ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(form_builder, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ BuilderBase
constructor
A new instance of BuilderBase.
- #label(label_html_options = {}, &block) ⇒ Object
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_with_client_validation/action_view_extensions/builder.rb', line 8 def initialize(form_builder, method_name, object, sanitized_attribute_name, text, value, ) @form_builder = form_builder @method_name = method_name @object = object @sanitized_attribute_name = sanitized_attribute_name @text = text @value = value @input_html_options = end |
Instance Attribute Details
#object ⇒ Object (readonly)
:nodoc:
6 7 8 |
# File 'lib/simple_form_with_client_validation/action_view_extensions/builder.rb', line 6 def object @object end |
#text ⇒ Object (readonly)
:nodoc:
6 7 8 |
# File 'lib/simple_form_with_client_validation/action_view_extensions/builder.rb', line 6 def text @text end |
#value ⇒ Object (readonly)
:nodoc:
6 7 8 |
# File 'lib/simple_form_with_client_validation/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_with_client_validation/action_view_extensions/builder.rb', line 19 def label(={}, &block) @form_builder.label(@sanitized_attribute_name, @text, , &block) end |