Open ck2000 opened 7 years ago
I would like to add a default select statement to my filterrific config.
e.g.
@localities = Locality.where(company_id: @company.id) @filterrific = initialize_filterrific( Locality, params[:filterrific], :select_options => { sorted_by: Locality.options_for_sorted_by, with_city: Locality.distinct.pluck(:city) } ) or return @localities = @filterrific.find().page(params[:page])
Could you please help me?
You should be able to do this in the code for your model using the default_filter_params hash.
default_filter_params
I would like to add a default select statement to my filterrific config.
e.g.
@localities = Locality.where(company_id: @company.id) @filterrific = initialize_filterrific( Locality, params[:filterrific], :select_options => { sorted_by: Locality.options_for_sorted_by, with_city: Locality.distinct.pluck(:city) } ) or return @localities = @filterrific.find().page(params[:page])
Could you please help me?