Search everywhere and in a hurry!
Ransack adds searching and sorting to your Rails application with plain Ruby and ERB, without a search server or any other infrastructure.
Ransack is supported for Rails 8.1 on Ruby 3.3 and later, on Postgres, MySQL, Trilogy and SQLite.
gem 'ransack'@q = Post.ransack(params[:q])
@posts = @q.result<%= search_form_for @q do |f| %>
<%= f.search_field :title_cont %>
<% end %>
<%= sort_link(@q, :published_at) %>activerecord-hackery.github.io/ransack:
getting started,
authorization,
predicates,
upgrading
and more. The site is built from the Markdown under docs/.
- ActiveAdmin, the Rails admin framework whose filters are built on Ransack
- Avo, admin panels and internal tools for Rails, with search powered by Ransack
- Spree, the open source commerce platform, which uses Ransack for its search and filtering
- Solidus, the open source eCommerce framework, which uses Ransack for its search and filtering
- mobility-ransack, which searches attributes translated with Mobility
- ransack_memory, which saves and restores Ransack's search params in the session
- Ransack demo, an app showing advanced search forms built with Ransack
- Questions belong in GitHub Discussions.
- Reproducible bugs belong in Issues. Read the Contributing Guide first; a failing test is the best bug report.
- Report security vulnerabilities privately, through GitHub private vulnerability reporting or the Tidelift security contact. See the Security Policy for supported versions.
Ransack is maintained by volunteers. If it is useful to you, please consider supporting us via Open Collective, or through the Tidelift Subscription for commercial support.
Ransack is maintained by Sean Carroll, Deivid Rodriguez and a great group of contributors. It was created by Ernie Miller. See Community and support for the full list.