Add a search bar to a Rails product listing that filters by name, price, or category without external search infrastructure.
Build a sortable, filterable admin table in a Ruby on Rails app with a single gem install.
Add multi-language search form labels to a Rails app that serves users in multiple languages.
Ransack is a Ruby gem that adds search functionality to Rails web applications. If you are building a website with Ruby on Rails and want users to be able to filter or search through records in your database, such as a product list or an admin table, Ransack provides a straightforward way to do that using standard Ruby code and HTML templates. The main advantage Ransack advertises is that it works without any additional services. Options like Elasticsearch or Algolia require running separate infrastructure and learning their own query languages. Ransack works directly against the existing database through Rails's built-in database layer, so there is nothing extra to install or pay for beyond adding the gem to your project. Installation is a single line in the Gemfile. The gem supports current versions of Rails (7.2, 8.0, and 8.1 are listed) running on Ruby 3.1 and later. There is an extensive documentation site for the project, and a quick-start cheat sheet is linked in the README for developers who want to get something working quickly. Ransack also supports internationalization, meaning search labels and messages can be translated for applications that serve users in multiple languages. Questions and help are handled through Stack Overflow and GitHub Discussions rather than the issue tracker, which is reserved for confirmed bugs. The project is open source and funded through Open Collective for ongoing maintenance.
← activerecord-hackery on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.