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 <[email protected]>
wrote:
> On May 11, 4:01 am, Ar Chron <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to