Show booleans in Active Admin as 'Yes' and 'No'

welldan97 picture welldan97 · Apr 26, 2012 · Viewed 11.5k times · Source

How can I make active admin to show "Yes" and "No" instead of "true" and "false".

I tried to change in english locale but that doesn't work. I'm thinking of monkeypatching boolean classes, but this seems quite ugly.

Is there anything else I can do?

Answer

superluminary picture superluminary · May 15, 2013

You might like to do something like this:

index do
  id_column
  column(:published) do |story| 
    story.published? ? status_tag( "yes", :ok ) : status_tag( "no" )
  end
end

This will wrap the words "yes" and "no" in status tags which look rather good.