Module: ActiveAdminAddons::InputHtmlHelpers

Includes:
InputMethods
Included in:
InputBase
Defined in:
lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb

Instance Method Summary collapse

Methods included from InputMethods

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

Instance Method Details

#build_hidden_control(id, name, value = nil) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 34

def build_hidden_control(id, name, value = nil)
  builder.hidden_field(
    valid_method,
    id: id,
    name: name,
    value: value
  )
end

#build_separatorObject



30
31
32
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 30

def build_separator
  template.(:span, "-", class: "separator")
end

#empty_input_idObject



26
27
28
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 26

def empty_input_id
  "#{prefixed_method}_empty"
end

#method_to_input_array_nameObject



13
14
15
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 13

def method_to_input_array_name
  "#{method_to_input_name}[]"
end

#method_to_input_id(id) ⇒ Object



17
18
19
20
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 17

def method_to_input_id(id)
  raise "invalid input id" if id.blank?
  "#{prefixed_method}_#{id}"
end

#method_to_input_nameObject



9
10
11
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 9

def method_to_input_name
  "#{model_name}[#{valid_method}]"
end

#prefixed_methodObject



5
6
7
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 5

def prefixed_method
  "#{model_name}_#{valid_method}"
end

#selected_values_idObject



22
23
24
# File 'lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb', line 22

def selected_values_id
  "#{prefixed_method}_selected_values"
end