Class: CountryOptionsSelect::CountryOptionsSelectTag

Inherits:
ActionView::Helpers::Tags::Base
  • Object
show all
Defined in:
lib/country_options_select/helpers/select_tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(select_type, object_name, method_name, template_object, options, html_options) ⇒ CountryOptionsSelectTag

Returns a new instance of CountryOptionsSelectTag.



5
6
7
8
9
10
11
12
13
14
# File 'lib/country_options_select/helpers/select_tag.rb', line 5

def initialize(select_type, object_name, method_name, template_object, options, html_options)
  @select_type = select_type

  options = options.dup
  @country_select_options = options.extract!(*%i(text_format updates removals options_override order selected disabled html_attributes))

  @html_options = html_options

  super(object_name, method_name, template_object, options)
end

Instance Method Details

#renderObject



16
17
18
19
20
# File 'lib/country_options_select/helpers/select_tag.rb', line 16

def render
  (
    send("country_#{@select_type}_for_select", **@country_select_options), @options, @html_options
  )
end