ActiveAdmin filter boolean as single checkbox

Viewed 5012

How can i filter a boolean value using a single checkbox?

For example the following gives me two checkboxes with yes and no values:

ActiveAdmin.register User do    
  filter :is_retired, :as => :check_boxes
end

HBTM association is filtered as follows:

filter :roles_id, :as => :check_boxes, :collection => proc { Role.all }

But i have a boolean field in my User model and need a single checkbox with Is retired label. Is it possible somehow?

2 Answers
filter :is_retired,
  as: :check_boxes,
  collection: [['Yes', true]],
  label: 'Retired?'
Related