Sha256: c169abf3e11954520c256432df4e1407d6aca16621d676b9432221249b0e9e9a
Contents?: true
Size: 903 Bytes
Versions: 5
Compression:
Stored size: 903 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 # Can pass proc to filter label option def label_from_options res = super res = res.call if res.is_a? Proc res 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_exec(&options[:collection]) else super end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems