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
Written by Tony612
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Related Tags
#rails
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#