The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Ruby and Rails Syntax Tips - The Difference Between blank?, nil?, and empty?

by wjgilmore — 8 April 2014

When working with Ruby and Rails, a common source of confusion involves mixing up nil?, blank?, and empty?. All three methods clearly deal with determining whether a data structure is assigned a value, but there are different degrees of nothingness, and in the world of programming those degrees are important. This blog post helps to dispel the confusion by working through a number of different examples.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will bedirected via GitHub to signup or sign in