Sha256: f6694e27771e6c07ea5cdcd9e08f03358af881c15df3668d3763f0205afd64da

Contents?: true

Size: 871 Bytes

Versions: 59

Compression:

Stored size: 871 Bytes

Contents

module ActiveAdmin
  module Inputs
    class FilterCheckBoxesInput < ::Formtastic::Inputs::CheckBoxesInput
      include FilterBase

      def input_name
        "#{object_name}[#{association_primary_key || method}_in][]"
      end

      def selected_values
        @object.send("#{association_primary_key || method}_in") || []
      end

      # Add whitespace before label
      def choice_label(choice)
        " #{super(choice)}"
      end

      # Don't wrap in UL tag
      def choices_group_wrapping(&block)
        template.capture(&block)
      end

      # Don't wrap in LI tag
      def choice_wrapping(html_options, &block)
        template.capture(&block)
      end

      # Don't render hidden fields
      def hidden_field_for_all
        ""
      end

      # Don't render hidden fields
      def hidden_fields?
        false
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 3 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/lib/active_admin/inputs/filter_check_boxes_input.rb