Ruby %w empty value -
how add empty string select option %w(mr ms mrs miss)
?
i can ['', 'mr', 'ms', 'mrs', 'miss']
use %w
. thx!
use unshift
prepended object front:
=> %w(mr ms mrs miss).unshift "" #> ["", "mr", "ms", "mrs", "miss"]
pretty version without brackets.
ok update:
=> %w(#{} mr ms mrs miss) #> ["", "mr", "ms", "mrs", "miss"]
explain:
%w
- allow interpolation%w
- not allow interpolation#{}
- empty string
Comments
Post a Comment