Merged
requested to merge github/fork/jonatasrancan/feature/search-through-association-fields into master
Created by: jonatasrancan
After searching the documentation I didn't find anything about searching using the association
fields, and also I didn't find any open PR related to this, so I decided to open this PR.
The approach I used was using with_options
, when declaring a field on the dashboard, and added a new option called searchable_field
.
The dashboard will look like this:
class StateDashboard < Administrate::BaseDashboard
....
country: Administrate::Fields::BelongsTo.with_options(searchable: true, searchable_field: 'name')
....