10 6 / 2016

This will work with pre 1.0.0 versions where active_admin used metasearch gem for filters. Below is how you can add a custom field as filter and use it to generate search results using a custom search function:

For me active_admin did break down when we added a polymorphic association to an existing model, and the filter on association stopped working. We suddenly started seeing “no implicit conversion of nil into String“ exceptions. I then had to figure out how to write a custom filter for active admin - and believe me it was like walking in the Sahara Desert =P , with little/no documentation around.

Do let me know in case this helped you and I saved you from getting lost in the great Sahara ;)

image
Comments

18 4 / 2012

Add the following to initializers/active_admin.rb:

config.default_per_page = 50

Posting it here because I couldn’t find this information in documentation, or elsewhere.

Comments
blog comments powered by Disqus