Class: SelectedListInput

Inherits:
ActiveAdminAddons::InputBase show all
Defined in:
app/inputs/selected_list_input.rb

Instance Method Summary collapse

Methods inherited from ActiveAdminAddons::InputBase

#concat, #input_html_options, #load_input_class, #parts, #parts_to_html, #to_html

Methods included from ActiveAdminAddons::InputHtmlHelpers

#build_hidden_control, #build_separator, #empty_input_id, #method_to_input_array_name, #method_to_input_id, #method_to_input_name, #prefixed_method, #selected_values_id

Methods included from ActiveAdminAddons::InputMethods

#association_name, #build_virtual_attr, #input_association_value, #input_related_items, #input_value, #method_model, #model_name, #object_class, #tableize_method, #translated_method, #url_from_method, #valid_method, #valid_object

Methods included from ActiveAdminAddons::InputOptionsHandler

#attr_options, #control_attributes, #css_classes, #data_attr_options, #get_data_attr_value, #load_attr, #load_class, #load_data_attr

Instance Method Details

#load_control_attributesObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/inputs/selected_list_input.rb', line 7

def load_control_attributes
  load_class(@options[:class])
  load_data_attr(:model, value: model_name)
  load_data_attr(:method, value: method)
  load_data_attr(:url, default: url_from_method)
  load_data_attr(:response_root, default: tableize_method)
  load_data_attr(:fields, default: ["name"], formatter: :to_json)
  load_data_attr(:predicate, default: "contains")
  load_data_attr(:display_name, default: "name")
  load_data_attr(:minimum_input_length, default: 1)
  load_data_attr(:width, default: "100%")
  load_data_attr(
    :order,
    value: @options[:order_by],
    default: get_data_attr_value(:fields).first.to_s + "_desc"
  )
end

#render_custom_inputObject



2
3
4
5
# File 'app/inputs/selected_list_input.rb', line 2

def render_custom_input
  concat(label_html)
  concat(render_control_wrapper)
end