Class: ActiveAdminAddons::BoolBuilder

Inherits:
CustomBuilder show all
Defined in:
lib/activeadmin_addons/addons/bool_builder.rb

Constant Summary collapse

DEFAULT_BOOLEAN_TRUE =
"✔"
DEFAULT_BOOLEAN_FALSE =
"✗"

Instance Attribute Summary

Attributes inherited from CustomBuilder

#args, #block, #context, #model

Instance Method Summary collapse

Methods inherited from CustomBuilder

builder_method_name, create_view_methods, #initialize

Constructor Details

This class inherits a constructor from ActiveAdminAddons::CustomBuilder

Instance Method Details

#renderObject



6
7
8
9
10
11
12
# File 'lib/activeadmin_addons/addons/bool_builder.rb', line 6

def render
  if data
    i18n_lookup("true_value", DEFAULT_BOOLEAN_TRUE)
  else
    i18n_lookup("false_value", DEFAULT_BOOLEAN_FALSE)
  end
end