I am trying to make a new custom filter in ActiveAdmin of a rails application. When I put bellow code
filter :premium_scenes_in
it displays a input field as text input field (with option "contains", "equals" and etc) but I want an input field as numeric with option "equals", "greater than" or "less than".
I tried to use:
filter :premium_scenes_in, as: :numeric
or filter :premium_scenes_in, as: :numeric_range
But each time it shows an error Unable to find input class NumaricRangeInput
This is my code in model
ransacker :premium_scenes,
formatter: proc { |number|
results = Tour.all.map{|tour| tour if tour.scenes.count > number}
results = results.present? ? results : nil
}, splat_params: true do |parent|
parent.table[:id]
end
I think you meant as: :number
. The supported input types are documented in the Formtastic README here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.