Class: ActiveAdminAddons::InputBase
Instance Method Summary
collapse
#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
#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
#attr_options, #control_attributes, #css_classes, #data_attr_options, #get_data_attr_value, #load_attr, #load_class, #load_data_attr
Instance Method Details
#concat(part) ⇒ Object
49
50
51
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 49
def concat(part)
parts << part
end
|
22
23
24
25
26
27
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 22
def input_html_options
super.except(:maxlength, :size).merge(control_attributes)
end
|
#load_control_attributes ⇒ Object
37
38
39
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 37
def load_control_attributes
end
|
33
34
35
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 33
def load_input_class
load_class(self.class.to_s.underscore.dasherize)
end
|
#parts ⇒ Object
45
46
47
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 45
def parts
@parts ||= []
end
|
#parts_to_html ⇒ Object
29
30
31
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 29
def parts_to_html
parts.flatten.join("\n").html_safe
end
|
41
42
43
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 41
def render_custom_input
end
|
#to_html ⇒ Object
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/activeadmin_addons/support/input_base.rb', line 11
def to_html
load_input_class
load_control_attributes
render_custom_input
if parts.any?
return input_wrapping { parts_to_html }
else
super
end
end
|