Skip to content

Latest commit

 

History

History
97 lines (72 loc) · 1.43 KB

boolean_values.md

File metadata and controls

97 lines (72 loc) · 1.43 KB

Boolean values

Bool Row

Modifies how boolean values are displayed in attributes_table control (the one used in show view)

You just need to use bool_row method

show do
  attributes_table do
    bool_row :paid
  end
end

Bool Column

Modifies how boolean values are displayed in index view

You just need to use bool_column method

index do
  bool_column :paid
end

Style

You can set your own style for boolean values, adding the following code to active_admin.scss file.

.bool-value {
  font-size: 12px;

  &.true-value {
    color: #08A510;
  }

  &.false-value {
    color: #FF0000;
  }
}

i18n Support

The default values are:

  • true: ✔
  • false: ✗

Modifing the default

es:
  activeadmin:
    addons:
      boolean:
        default:
          true_value: pagada
          false_value: no pagada

Modifing a specific model

es:
  activeadmin:
    addons:
      boolean:
        models:
          invoice:
            true_value: pagada
            false_value: no pagada

Modifing an specific model attribute

es:
  activeadmin:
    addons:
      boolean:
        models:
          invoice:
            paid:
              true_value: pagada
              false_value: no pagada