From: Christopher Dicely Date: 2008-04-20T04:48:14+09:00 Subject: Re: if behavior On Sat, Apr 19, 2008 at 5:14 AM, Qwe Qwe wrote: > ehm great > > if true then > @users = User.find( :all ) > else > @users = User.find( :all ) > end if > 1 > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @users } > end > > works, but commenting out 1 > > if true then > @users = User.find( :all ) > else > @users = User.find( :all ) > end if > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @users } > end > > makes the if not evaluated. > > why? see "If and unless modifiers", on this page: http://www.rubycentral.com/pickaxe/tut_expressions.html