Class: Shoelace::Components::SlCollectionSelect

Inherits:
ActionView::Helpers::Tags::CollectionSelect
  • Object
show all
Includes:
ErrorWrappable, SlSelectRenderable
Defined in:
app/helpers/shoelace/components/sl_select.rb

Overview

:nodoc:

Constant Summary

Constants included from SlSelectRenderable

Shoelace::Components::SlSelectRenderable::EMPTY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SlSelectRenderable

#select_content_tag

Methods included from ErrorWrappable

#error_wrapping

Constructor Details

#initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options, slot) ⇒ SlCollectionSelect

Returns a new instance of SlCollectionSelect.



51
52
53
54
# File 'app/helpers/shoelace/components/sl_select.rb', line 51

def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options, slot)
  @slot = slot
  super(object_name, method_name, template_object, collection, value_method, text_method, options, html_options)
end

Instance Attribute Details

#slotObject (readonly)

Returns the value of attribute slot.



49
50
51
# File 'app/helpers/shoelace/components/sl_select.rb', line 49

def slot
  @slot
end

Instance Method Details

#options_from_collection_for_select(collection, value_method, text_method, selected = nil) ⇒ Object



56
57
58
# File 'app/helpers/shoelace/components/sl_select.rb', line 56

def options_from_collection_for_select(collection, value_method, text_method, selected = nil)
  @template_object.sl_options_from_collection_for_select(collection, value_method, text_method, selected)
end