Custom search with ransacker

后端 未结 2 1303
孤独总比滥情好
孤独总比滥情好 2020-12-25 08:01

I\'m trying to add a custom filter to ActiveAdmin which is powered by Ransack these days. Unfortunately, ransacker is not documented at all and from the few res

2条回答
  •  不思量自难忘°
    2020-12-25 08:49

    in or cont_any do a search via an array. So in this case, it's doing a search Model.where(something: ["tom", "tom1", "tom2"] and because of the way the params[:q] works, it returns it to your input as an array. A quick and dirty fix I did to help user experience is added value: nil, to the input form

提交回复
热议问题