finds.dev← search

// the find

activerecord-hackery/ransack

★ 5,863 · Ruby · MIT · updated May 2026

Object-based searching.

Ransack is a Rails search gem that turns URL params like `q[name_cont]=foo` into ActiveRecord queries, with form helpers to build filter UIs. It's the go-to solution when you need multi-field filtering on a Rails admin or index page without spinning up Elasticsearch. Actively maintained, supports Rails 8.x.

The predicate system (`_cont`, `_eq`, `_gt`, `_in`, etc.) covers the vast majority of filtering cases with zero SQL writing. The `ransacker` DSL lets you define custom searchable attributes when the defaults fall short. Polyamorous join handling means cross-association searches work without manual joins. i18n support across 25+ locales is a real differentiator for internationalized apps.

URL-based search params are a double-edged sword — exposing them directly without `ransackable_attributes` whitelisting is a well-known mass-assignment-style vulnerability that still bites people. Performance gets ugly fast on large datasets with complex OR groupings; it generates some genuinely bad SQL in those cases. No full-text search support — `_cont` is a `LIKE '%foo%'` with no index support, so it'll table-scan at scale. The query object model is opaque; debugging why a specific SQL was generated requires digging through several layers of visitor/node code.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →