enum_help icon indicating copy to clipboard operation
enum_help copied to clipboard

"No" shown as "false"

Open micred opened this issue 9 years ago • 1 comments

When I have an enum option that is translated as "No", simple_form shows "false". Am I wrong?

PS: workaround is adding a space after "No":

enums:
  user:
    product_already_have_km:
      already_customer: 'Sì'
      new_customerr: 'No '

micred avatar Mar 30 '16 07:03 micred

'No' should work. A bare word No means false in YAML; I guess it was the case for you.

      new_customerr: No #=> false
      new_customerr: 'No' #=> "No"
      new_customerr: "No" #=> "No"

You should also be careful if you use "yes" or "no" as a key.

      yes: 'Sì' # Bad; the key is treated as `true`.
      'yes': 'Sì' # Good

knu avatar Oct 25 '19 05:10 knu