Ruby helper of the day: Array.compact I just found this handy helper: list.reject(&:nil?) == list.compact It removes any nil elements from a given array see: docs Share this: Share on X (Opens in new window) X Share on LinkedIn (Opens in new window) LinkedIn Share on Pocket (Opens in new window) Pocket More Email a link to a friend (Opens in new window) Email Share on Flattr (Opens in new window) Flattr Print (Opens in new window) Print Share on Reddit (Opens in new window) Reddit Share on Tumblr (Opens in new window) Tumblr Like Loading... Related