我正在尝试使用 Ransack 进行搜索,但是当我尝试搜索 id 和字符串时遇到问题,例如
:id_or_title_or_user_username_cont
它产生错误
ActionView::Template::Error (PG::UndefinedFunction: ERROR: operator does not exist: integer ~~* integer
我也试过这个
:id_eq_or_title_or_user_username_cont
它产生以下错误
Ransack::Search 的未定义方法 `id_eq_or_title_or_user_username_cont'
除了自定义谓词或自定义谓词之外,使用 ransack 一起搜索 id 和字符串的适当方法是什么?