Class: ActiveAdmin::Inputs::FilterHabtmInput

Inherits:
FilterSelectInput
  • Object
show all
Includes:
FilterBase
Defined in:
lib/active_admin_relationship_filters/filters/filter_habtm_input.rb

Instance Method Summary collapse

Methods included from FilterBase

#wrapper_html_options

Instance Method Details

#extra_input_html_optionsObject



26
27
28
# File 'lib/active_admin_relationship_filters/filters/filter_habtm_input.rb', line 26

def extra_input_html_options
  {}
end

#input_nameObject



13
14
15
16
# File 'lib/active_admin_relationship_filters/filters/filter_habtm_input.rb', line 13

def input_name
  name = super.sub("_ids_eq", "")
  "#{name}s_id_in"
end

#input_optionsObject



18
19
20
# File 'lib/active_admin_relationship_filters/filters/filter_habtm_input.rb', line 18

def input_options
  super.merge(:include_blank => I18n.t('active_admin.any'))
end

#methodObject



22
23
24
# File 'lib/active_admin_relationship_filters/filters/filter_habtm_input.rb', line 22

def method
  super.to_s.sub(/_id$/,'').to_sym
end

#to_htmlObject



6
7
8
9
10
11
# File 'lib/active_admin_relationship_filters/filters/filter_habtm_input.rb', line 6

def to_html
  input_wrapping do
    label_html <<
      (options[:group_by] ? grouped_select_html : select_html)
  end
end