Add the helper below, and you will be able to style true/false values like this:

final-result

app/helpers/application_helper.rb:

# boolean green or red

  def boolean_label(value)
    case value
    when true
      text = 'Yes'
      badge_color = 'badge bg-success text-light'
    when false
      text = 'No'
      badge_color = 'badge bg-danger text-light'
    end
    tag.span(text, class: badge_color)
  end

your view:

= boolean_label(user.confirmed?)