The Difference Between nil?, empty?, and blank? in Ruby
In Ruby, you can use nil? method to check if the object is nil. However, Ruby also provides empty? and there’s a blank? method in Rails. For a Ruby (or Rails) newbie, it can get quite confusing, it certainly did for me. This post explains which method to use when. Hope it simplifies things a little.