Ransack Demo Application
This is a quick demonstration of how you might use Ransack in a Rails 5 application to create an "advanced" search form, with nesting, etc.
The main things you'll want to note are:
- app/models/user.rb - Demonstration of:
- using a "ransacker" (a virtual, searchable "column") to allow searching on full names from concatenated first and last names.
- whitelisting attributes allowed for searching using
- whitelisting attributes allowed for sorting using
- app/views/users/ - Search form and various partials used in dynamic form.
- app/helpers/application_helper.rb -
Let us know if you have any questions, and happy ransacking!