Sha256: 684f6c602549d8e980447f828bd1ae257a85757eec03406721fc7177080f5427
Contents?: true
Size: 431 Bytes
Versions: 10
Compression:
Stored size: 431 Bytes
Contents
# frozen_string_literal: true module Decidim # Helper to print booleans in a human way. module HumanizeBooleansHelper # Displays booleans in a human way (yes/no, supporting i18n). Supports # `nil` values as `false`. # # boolean - a Boolean that will be displayed in a human way. def humanize_boolean(boolean) value = boolean ? "true" : "false" I18n.t(value, scope: "booleans") end end end
Version data entries
10 entries across 10 versions & 1 rubygems