Class: Maquina::Application::Components::SelectComponent

Inherits:
ComponentBase
  • Object
show all
Defined in:
app/views/maquina/application/components/select_component.rb

Instance Method Summary collapse

Methods inherited from ComponentBase

#initialize

Methods included from Maquina::ApplicationView

#attribute_human_name, #button_to, #image_tag, #link_to, #model_human_name, #svg_icon

Constructor Details

This class inherits a constructor from Maquina::Application::Components::ComponentBase

Instance Method Details

#view_templateObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/views/maquina/application/components/select_component.rb', line 9

def view_template
  options = input_html(no_helpers: true).deep_dup

  div(**control_html) do
    @form.label attribute_name, class: "label #{label_css_class}"
    div(class: "mt-1") do
      @form.select attribute_name, to_values!(options), extract_options!(options), options
      help_template
      error_template
    end
  end
end