module Maglev::Form::Inputs::Combobox
def combobox(method, options = {})
def combobox(method, options = {}) attributes = field_attributes(method) @template.render(Maglev::Uikit::Form::ComboboxComponent.new( label: options[:label].presence || attributes[:content], name: attributes[:name], search_path: options[:search_path], options: combobox_component_options(method, options), html_options: options[:html_options] )) end
def combobox_component_options(method, options)
def combobox_component_options(method, options) { value: options.key?(:value) ? options[:value] : object.public_send(method), selected_label: options[:selected_label], label_name: options[:label_name], placeholder: options[:placeholder], error: error_messages(method) } end