Module: ActiveAdmin::Inputs::FilterBase
- Includes:
- Formtastic::Inputs::Base
- Included in:
- FilterBooleanInput, FilterCheckBoxesInput, FilterDateRangeInput, FilterNumericInput, FilterSelectInput, FilterStringInput
- Defined in:
- lib/active_admin/inputs/filter_base.rb
Instance Method Summary (collapse)
-
- (Object) collection_from_options
Override the standard finder to accept a proc.
-
- (Object) humanized_method_name
Returns the default label for a given attribute Will use ActiveModel I18n if possible.
- - (Object) input_wrapping(&block)
-
- (Object) reflection_for(method)
Returns the association reflection for the method if it exists.
- - (Boolean) required?
- - (Object) wrapper_html_options
Instance Method Details
- (Object) collection_from_options
Override the standard finder to accept a proc
22 23 24 25 26 27 28 |
# File 'lib/active_admin/inputs/filter_base.rb', line 22 def if [:collection].is_a?(Proc) template.instance_eval(&[:collection]) else super end end |
- (Object) humanized_method_name
Returns the default label for a given attribute Will use ActiveModel I18n if possible
32 33 34 35 36 37 38 |
# File 'lib/active_admin/inputs/filter_base.rb', line 32 def humanized_method_name if object.base.respond_to?(:human_attribute_name) object.base.human_attribute_name(method) else method.to_s.send(builder.label_str_method) end end |
- (Object) input_wrapping(&block)
6 7 8 9 10 11 |
# File 'lib/active_admin/inputs/filter_base.rb', line 6 def input_wrapping(&block) template.content_tag(:div, template.capture(&block), ) end |
- (Object) reflection_for(method)
Returns the association reflection for the method if it exists
41 42 43 |
# File 'lib/active_admin/inputs/filter_base.rb', line 41 def reflection_for(method) @object.base.reflect_on_association(method) if @object.base.respond_to?(:reflect_on_association) end |
- (Boolean) required?
13 14 15 |
# File 'lib/active_admin/inputs/filter_base.rb', line 13 def required? false end |
- (Object) wrapper_html_options
17 18 19 |
# File 'lib/active_admin/inputs/filter_base.rb', line 17 def { :class => "filter_form_field #{as}" } end |