123456789_123456789_123456789_123456789_123456789_

Class: ActionView::Helpers::Tags::CollectionHelpers::Builder

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: actionview/lib/action_view/helpers/tags/collection_helpers.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ Builder

[ GitHub ]

  
# 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, input_html_options)
  @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 = input_html_options
end

Instance Attribute Details

#object (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8

attr_reader :object, :text, :value

#text (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8

attr_reader :object, :text, :value

#value (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8

attr_reader :object, :text, :value

Instance Method Details

#label(label_html_options = {}, &block)

[ GitHub ]

  
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 22

def label(label_html_options = {}, &block)
  html_options = @input_html_options.slice(:index, :namespace).merge(label_html_options)
  html_options[:for] ||= @input_html_options[:id] if @input_html_options[:id]

  @template_object.label(@object_name, @sanitized_attribute_name, @text, html_options, &block)
end