bingo bob, you just wanna use
unless params[:location][:id].blank? # location is set else # no location at all end in your controller like Fred above suggested. blank? is lifesaver. On May 11, 1:58 pm, Frederick Cheung <frederick.che...@gmail.com> wrote: > On May 11, 4:01 am, Ar Chron <rails-mailing-l...@andreas-s.net> wrote: > > > > unless params[:location][:id] || params[:location][:id].empty? > > > Or's short-circuit on the first true in the 'if' case, but are you sure > > it works as a full inverse in the 'unless' case? > > > If it's: unless (condA || condB), which makes sense to me, you're out of > > luck. > > > If condA is false, it WILL go after condB... > > > Rewrite it as an 'if' > > yup, expanding de morgan's laws in your head are a recipe for > disaster. (and don't forget about the blank? method). > > Fred > > > -- > > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---