Um, what is Filterameter?

I’m glad you asked. The filterameter gem simplifies your Rails controllers by providing a DSL for filter parameters. Rather than manually checking for the presence of query params then building up an ActiveRecord query, you can just declare the filters you want.

Here’s a code snippet from a controller that shows accounting entries:

filter :type, name: :account_type, association: :account
filter :account_id
filter :partner_id
filter :accounting_date, range: true
filter :amount, range: true

That code does what you’d expect. Which is kind of nice.

1 Like