jhund / filterrific

Filterrific is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists.
http://filterrific.clearcove.ca
MIT License
910 stars 124 forks source link

Problematic piece of code in the documentation #90

Closed acrolink closed 8 years ago

acrolink commented 8 years ago

Thanks for this great utility. Inside Index definition in the documentation wrote these lines:

      persistence_id: 'shared_key',
      default_filter_params: {},
      available_filters: [],

I have noticed that these three lines make the filter non-functional (filters nothing). If I omit them, everything works perfectly. Any idea what might be going on here? Thanks.

blaedj commented 8 years ago

The available_filters parameter specifies which filters are allowed, and will override the filters defined on the model. The code in the documentation sets the applied filters to none, regardless what you define on the model.

acrolink commented 8 years ago

Thank @blaedj for the clarification.