Class: ActionView::Helpers::Tags::CollectionHelpers::Builder
- Defined in:
- actionview/lib/action_view/helpers/tags/collection_helpers.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ Builder
constructor
A new instance of Builder.
- #label(label_html_options = {}, &block) ⇒ Object
Constructor Details
#initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ Builder
Returns a new instance of Builder.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 10 def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, ) @template_object = template_object @object_name = object_name @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)
Returns the value of attribute object
8 9 10 |
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8 def object @object end |
#text ⇒ Object (readonly)
Returns the value of attribute text
8 9 10 |
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8 def text @text end |
#value ⇒ Object (readonly)
Returns the value of attribute value
8 9 10 |
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8 def value @value end |
Instance Method Details
#label(label_html_options = {}, &block) ⇒ Object
22 23 24 25 26 27 |
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 22 def label( = {}, &block) = @input_html_options.slice(:index, :namespace).merge() [:for] ||= @input_html_options[:id] if @input_html_options[:id] @template_object.label(@object_name, @sanitized_attribute_name, @text, , &block) end |