Last Updated: February 25, 2016
·
298
· tony612

foo.blank? in Rails

An object is blank if it’s false, empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are all blank.

You can regard it as

foo.blank?
foo.nil? || foo.empty

And, there's not the method in ruby, you can't use it in irb.

Refering the doc