Class: Maquina::Application::Components::CheckboxComponent

Inherits:
ComponentBase
  • Object
show all
Defined in:
app/views/maquina/application/components/checkbox_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



7
8
9
10
11
12
13
14
15
16
17
# File 'app/views/maquina/application/components/checkbox_component.rb', line 7

def view_template
  div(**control_html) do
    div(class: "flex h-5 items-center") do
      @form.check_box attribute_name, **input_html
    end
    div(class: "text-sm leading-6") do
      @form.label attribute_name, class: "label #{label_css_class}"
      help_template
    end
  end
end