I'd like to use ransack (via ActiveAdmin) to do full-text searches on a model.
How can I get ransack to use pg_search for its query? I want to run queries that, among other query components, use pg_search functionality.
You don't need ransack to use pg_search, just combine the scopes. They're meant to work together.
Here I'm using several different gems to work together for a search:
@lessons = Lesson.
by_fuzzy_name("foo"). # pg_search scope
by_instructor_fullname("bob"). # pg_search scope
ransack(ransack_search_options).result. #ransack scope
active. # rails scope
page(page) # kaminari pagination
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With