Sha256: c6a4587ffe4a1e019cdfe60a27b7e55e5f52b6dfeebecba4003de06f450ecba1

Contents?: true

Size: 870 Bytes

Versions: 39

Compression:

Stored size: 870 Bytes

Contents

module ActiveAdmin
  module Inputs
    class FilterNumericRangeInput < ::Formtastic::Inputs::StringInput
      include FilterBase

      def to_html
        input_wrapping do
          [ label_html,
            builder.text_field(gt_input_name, input_html_options(gt_input_name)),
            template.content_tag(:span, "-".html_safe, :class => "seperator"),
            builder.text_field(lt_input_name, input_html_options(lt_input_name)),
          ].join("\n").html_safe
        end
      end

      def gt_input_name
        "#{method}_gte"
      end
      alias :input_name :gt_input_name

      def lt_input_name
        "#{method}_lte"
      end

      def input_html_options(input_name = gt_input_name)
        current_value = @object.send(input_name)
         { :size => 10, :id => "#{input_name}_numeric" , :value => current_value}
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
smartkiosk-server-0.10.15 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.14 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.13 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.12 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.11 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.10 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.9 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.8 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.7 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.5 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.4 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.3 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.2 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.1 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.10.0 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.9.3 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.9.2 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.9.1 lib/active_admin/inputs/filter_numeric_range_input.rb
smartkiosk-server-0.9.0 lib/active_admin/inputs/filter_numeric_range_input.rb