I usually do
value = input || "default"
so if input = nil
value = "default"
But how can I do this so instead of nil It also counts an empty string '' as nil
I want so that if I do
input = ''
value = input || "default"
=> "default"
Is there a simple elegant way to do this without if?
ruby-on-rails, hence the Rails specific answers.