From: Scott Barron Date: 2006-09-10T22:59:43+09:00 Subject: Re: Combine @item.foo.nil? || @item.foo.empty? ? ------=_Part_76817_9915854.1157896766379 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 9/8/06, Joe Ruby wrote: > > I have code like this in my (Markaby) templates: > > tr do > td @item.foo > end unless (@item.foo.nil? || @item.foo.empty?) > > Is there a way to combine these two OR clauses into one? > > tr do > td @item.foo > end unless @item.foo.nil_or_empty? > > Thanks, > Joe Perhaps #blank? from activesupport [1] could do what you want? -Scott [1] http://dev.rubyonrails.org/browser/tags/rel_1-1-6/activesupport/lib/active_support/core_ext/blank.rb ------=_Part_76817_9915854.1157896766379--