TRails of Popcorn
Blog Archive
▼
2007
(3)
▼
May
(1)
blank? stares
►
February
(2)
About Me
doktahahpah
View my complete profile
Tuesday, May 8, 2007
blank? stares
I have just this moment discovered that Rails extends the Object class with the blank? method. So now, you never have to ask:
if (! (email.nil? || email.empty?)) ...
Instead, you say:
if (! email.blank?) ...
Once again, less is more™.
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment