Sha256: de8bd0084d2d037449ecf38d4ecc608e3978f0d1de77c6f65774d2deb6020689

Contents?: true

Size: 531 Bytes

Versions: 47

Compression:

Stored size: 531 Bytes

Contents

module ActiveAdmin
  module Inputs
    class FilterSelectInput < ::Formtastic::Inputs::SelectInput
      include FilterBase

      def input_name
        "#{super}_eq"
      end

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

      def method
        if super.to_s.scan(/_id/).count('_id') == 1
          super.to_s.sub(/_id$/, '').to_sym
        else
          super.to_s.to_sym
        end
      end

      def extra_input_html_options
        {}
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.59 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
lalala-4.0.0.dev.58 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
lalala-4.0.0.dev.57 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
lalala-4.0.0.dev.56 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
lalala-4.0.0.dev.50 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
lalala-4.0.0.dev.46 vendor/deps/active_admin/lib/active_admin/inputs/filter_select_input.rb
activeadmin-0.5.1 lib/active_admin/inputs/filter_select_input.rb