Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julianrubisch/sr-filterable-reflex
https://github.com/julianrubisch/sr-filterable-reflex
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/julianrubisch/sr-filterable-reflex
- Owner: julianrubisch
- License: mit
- Created: 2021-05-04T10:01:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-04T10:47:20.000Z (over 3 years ago)
- Last Synced: 2024-12-12T14:34:42.890Z (15 days ago)
- Language: Ruby
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Decouple your filtering and faceted search using concerns
**How**
- Use a `Filterable` concern to [mediate](https://en.wikipedia.org/wiki/Mediator_pattern) between your controllers/concerns and the filtering logic
- In separate `Filter` classes, define how and which rules apply, and how to update filter params**Caveats**
The `Book` and `Restaurant` classes in this example mimick an `ActiveRecord` model. The array refinements simply serve as stand-ins for model scopes or AR queries.