Feature(s) impacted
Ordering Smart fields feature
Observed behavior
Cannot find in the ForestAdmin/Rails documentation a way to make it work.
Expected behavior
A symbol I can pass to the
field
definition that could be used to sort by Smart field
Context
Greetings,
- Project name: Trustpair
- Team name: Product
- Environment name: Development
- Gem version used:
gem 'forest_liana', '~> 7.4'
- Rails version:
6.1.4.7
- DB: Postgres
I recently was asked to make some fields available to filtering and sorting.
These fields are not directly persisted in the view I’m working on (we are talking about columns persisted in a related model - a belongs_to
model relationship).
I found a way to use filtering on one of the column I had to make filtering on, thanks to the documentation exemples and the source code.
But I wasn’t able to find a solution for the sorting feature.
The docs says to look on this page, but as it is a JS exemple, and the gem doesn’t seem to provide a way to give a lambda to the field
method and write some custom SQL to achieve this, I’m a bit lost.
Could you indicate me a way to handle this ?
Thanks.