The flexibility associated with Filterrific annoys me.
But I'm wondering how you can handle filtering multiple ActiveRecord models in one view.
Is there a way to add multiple models to the filterrific instance variable when initializing in the controller?
Therefore, instead of passing one model class, as in the code example below, adding additional model classes.
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
},
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
If it is not possible to add multiple models, is there another way to handle a scenario that requires filtering based on multiple models? Maybe additionally initialize filtering in a separate instance variable?
Thanks!