Class: PolymorphicSelect::PolymorphicSelector

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::FormOptionsHelper, ActionView::Helpers::TagHelper
Defined in:
lib/polymorphic_select/polymorphic_selector.rb

Instance Method Summary collapse

Constructor Details

#initialize(polymorph, choices, options = {}, html_options = {}) ⇒ PolymorphicSelector

Returns a new instance of PolymorphicSelector.



8
9
10
11
12
13
# File 'lib/polymorphic_select/polymorphic_selector.rb', line 8

def initialize(polymorph, choices, options = {}, html_options = {})
  @polymorph    = polymorph
  @choices      = choices
  @options      = options.dup
  @html_options = html_options.dup
end

Instance Method Details

#select_polymorphObject



15
16
17
# File 'lib/polymorphic_select/polymorphic_selector.rb', line 15

def select_polymorph
  build_options_and_select(selected_value, @choices)
end