Class: ColorPickerInput

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

Constant Summary collapse

DEFAULT_PALETTE =
[
  "#000000",
  "#333333",
  "#663300",
  "#CC0000",
  "#CC3300",
  "#FFCC00",
  "#009900",
  "#006666",
  "#0066FF",
  "#0000CC",
  "#663399",
  "#CC0099",
  "#FF9999",
  "#FF9966",
  "#FFFF99",
  "#99FF99",
  "#66FFCC",
  "#99FFFF",
  "#66CCFF",
  "#9999FF",
  "#FF99FF",
  "#FFCCCC",
  "#FFCC99",
  "#FFFFFF"
]

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



34
35
36
# File 'app/inputs/color_picker_input.rb', line 34

def load_control_attributes
  load_data_attr(:palette, default: DEFAULT_PALETTE, formatter: :to_json)
end

#render_custom_inputObject



29
30
31
32
# File 'app/inputs/color_picker_input.rb', line 29

def render_custom_input
  concat(label_html)
  concat(builder.hidden_field(method, input_html_options))
end