Skip to content
Tags

, ,

.present? and .blank?

March 24, 2011

.present? and .blank? seem to be the opposites of each other:

(rdb:2630) "".present?

false

(rdb:2630) nil.present?

false

(rdb:2630) "test".present?

true

(rdb:2630) "".blank?

true

(rdb:2630) nil.blank?

true

(rdb:2630) "test".blank?

false
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: