Sha256: fa6981a0320d7519e3d30631902b015bfa737f2ad201eb356ee9f27706d6cb09

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

module ActiveAdmin
  module Inputs
    class FilterHabtmInput < FilterSelectInput
      include FilterBase

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

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

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

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

      def extra_input_html_options
        {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_admin_relationship_filters-0.1.0 lib/active_admin_relationship_filters/filters/filter_habtm_input.rb