3

By default filter :foo where foo is an integer field will produce the equality filter. Are there any built-in ways to make it act just like date filter: to draw two inputs that will work like a range?

Fivell
  • 11,829
  • 3
  • 61
  • 99
inossidabile
  • 524
  • 4
  • 13

1 Answers1

4

No there is no such default one, but it's very easy to create it by yourself.

please see my gist with example https://gist.github.com/3995659

put it in initializers directory

use it like

 filter :id , :as => :numeric_range
BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
Fivell
  • 11,829
  • 3
  • 61
  • 99
  • 2
    Thank you. Also here are the CSS rules that will make this input look exactly as a date filter: https://gist.github.com/4015588 – inossidabile Nov 05 '12 at 06:04
  • If using a later version of ActiveAdmin, change `"#{method}_gte"` and `"#{method}_lte"` to `"#{method}_gteq"` and `"#{method}_lteq"` – Craig Kochis Oct 09 '14 at 01:51