Method: FormProps::Inputs::Select#render

Defined in:
lib/form_props/inputs/select.rb

#renderObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/form_props/inputs/select.rb', line 21

def render
  option_tags_options = {
    selected: @options.fetch(:selected) { value.nil? ? "" : value },
    disabled: @options[:disabled]
  }

  option_tags = if grouped_choices?
    grouped_options_for_select(@choices, option_tags_options)
  else
    options_for_select(@choices, option_tags_options)
  end

  select_content_props(option_tags, @options, @html_options)
end