Sha256: 8d06de23dbfc18015d90000c8dbddd805c53385102eeb1a22b18a578d2278af6

Contents?: true

Size: 748 Bytes

Versions: 12

Compression:

Stored size: 748 Bytes

Contents

module ActiveAdmin
  module Inputs
    module FilterBase
      include ::Formtastic::Inputs::Base
      include ::ActiveAdmin::Filters::FormtasticAddons

      extend ::ActiveSupport::Autoload
      autoload :SearchMethodSelect

      def input_wrapping(&block)
        template.content_tag :div, template.capture(&block), wrapper_html_options
      end

      def required?
        false
      end

      def wrapper_html_options
        { :class => "filter_form_field #{as}" }
      end

      # Override the standard finder to accept a proc
      def collection_from_options
        if options[:collection].is_a?(Proc)
          template.instance_eval(&options[:collection])
        else
          super
        end
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
activeadmin-0.6.6 lib/active_admin/inputs/filter_base.rb
activeadmin-0.6.5 lib/active_admin/inputs/filter_base.rb
activeadmin-0.6.4 lib/active_admin/inputs/filter_base.rb
yousty-activeadmin-1.0.4.pre lib/active_admin/inputs/filter_base.rb
yousty-activeadmin-1.0.3.pre lib/active_admin/inputs/filter_base.rb
yousty-activeadmin-1.0.2.pre lib/active_admin/inputs/filter_base.rb
activeadmin-0.6.3 lib/active_admin/inputs/filter_base.rb
yousty-activeadmin-1.0.1.pre lib/active_admin/inputs/filter_base.rb
yousty-activeadmin-1.0.0.pre lib/active_admin/inputs/filter_base.rb
activeadmin-0.6.2 lib/active_admin/inputs/filter_base.rb
activeadmin-0.6.1 lib/active_admin/inputs/filter_base.rb
aa-rails4-0.6.0 lib/active_admin/inputs/filter_base.rb