Is there any way to do this? I can't implement the counter cache because the where clause is used when retrieving a count. I saw similar issues but no answer was given: https://github.com/jbox-web/ajax-datatables-rails/issues/200 Any feedback or example is appreciated.