Flowdock

Good notes posted by newtonapple

RSS feed
June 20, 2008
13 thanks

Nil V.S. Empty String HTML Options

There is a difference between an empty string and nil value for options hash.

Code Sample

content_tag( :div, 'Hello World!', :class=>'') # => "<div class="">Hello World!</div>"
content_tag( :div, 'Hello World!', :class=>nil) # => "<div>Hello World!</div>"