Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filtering integer field with a range

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?

like image 472
inossidabile Avatar asked Dec 15 '25 17:12

inossidabile


1 Answers

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
like image 192
Fivell Avatar answered Dec 17 '25 22:12

Fivell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!