From: Michael Malone Date: 2009-02-19T11:04:22+09:00 Subject: Re: Dynamic string (depending on a variable) Guillaume Loader wrote: > I'm sorry for my english :( > Thanks for correcting! > > But still it doesn't work : > sentence = "Your ticket expired #{nb_of_days + ' days ago' if > nb_of_days > 0}#{'today' if nb_of_days==0}" > > Any suggestions? > > Thanks! > > > Sorry, I didn't actually run the code the first time! It was trying to use Fixnum's + method rather than String's This does work: sentence = "Your ticket expired #{nb_of_days.to_s + ' days ago' if nb_of_days > 0}#{'today' if nb_of_days==0}" ======================================================================= This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission. =======================================================================