From: "Peña, Botp" Date: 2009-02-19T11:35:37+09:00 Subject: Re: Dynamic string (depending on a variable) From: Guillaume Loader [mailto:picpic72@hotmail.com] # 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}" my initial suggestion is to always start slowly by splitting the problem into small parts... eg, > nb_of_days=0 => 0 > time_phrase = nb_of_days==0? "today" : "#{nb_of_days} day(s) ago" => "today" > sentence = "Your ticket expired "+time_phrase => "Your ticket expired today" you can then join them later if you want...