Sorry to reply in English (my German knowled very limited ...).

On Tue, Feb 24, 2009 at 11:20 PM, Adam Meyer <[email protected]> wrote:
> text @prints[i].empfaenger.name + (@prints[i].empfaenger.company = ""?
> "" : @prints[i].empfaenger.company + "\n") +

Are you really sure you did not intend something like this (with double ==):

   text @prints[i].empfaenger.name + (@prints[i].empfaenger.company == ""?
   "" : @prints[i].empfaenger.company + "\n") + ...

If you are inside Rails (not in 1.8.6 Ruby, only in Rails), you could also
write more neatly:

   text @prints[i].empfaenger.name + (@prints[i].empfaenger.company.blank? ?
   "" : @prints[i].empfaenger.company + "\n") + ...

The major advantage of blank? is that it will trap both nil values and empty
strings and also is more readable (the nil values could easily come from a NULL
in the database, or missing key in a params[] parameter list).

HTH,

Peter
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/listinfo/rubyonrails-ug

Antwort per Email an