How to filter IS NULL in ActiveAdmin?

前端 未结 5 778
迷失自我
迷失自我 2020-12-25 14:14

I\'ve a table with an integer column called \"map_id\", I want to add an activeadmin filter to filter if this column IS NULL or IS NOT NULL.

How could this be implem

5条回答
  •  太阳男子
    2020-12-25 14:58

    If anyone is happening on this thread belatedly, there is now an easy way to filter for null or non null in active admin :

    filter :attribute_present, :as => :boolean 
    filter :attribute_blank,   :as => :boolean  
    

    It is no longer necessary to add a custom method to the scope to accomplish this.

提交回复
热议问题