From: Brian Candler Date: 2009-12-27T04:33:36+09:00 Subject: Re: newbie: if is not null else... If you're using Rails (or more specifically the ActiveSupport library), then you can do x = '-' if x.blank? I thought it was worth mentioning in case the OP is moving from PHP to Rails. BTW you almost certainly won't want $x (a global variable) in Ruby. -- Posted via http://www.ruby-forum.com/.