Sha256: 864dcefec8b70ee3499c3821bbeeaee2e2aa6f99b65f15a229d8fda7e58ecd40
Contents?: true
Size: 432 Bytes
Versions: 141
Compression:
Stored size: 432 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
141 entries across 141 versions & 2 rubygems