From: "David A. Black" Date: 2008-10-16T20:58:09+09:00 Subject: Re: A Ruby block question Hi -- On Thu, 16 Oct 2008, David Trasbo wrote: > Stefano Crocco wrote: > >>> But how? >> >> I don't know Rails and Builder::XmlMarkup, so I can be completely wrong. >> From >> a quick look at Builder::XmlMarkup api, I'd say that, if the block >> returns the >> string you want to insert in the p element, you only have to insert it >> in m >> like you did for the texts: >> >> m << yield f > > Yes, that was also my first idea, but that is giving me this syntax > error: > > syntax error, unexpected tIDENTIFIER, expecting kEND Put f in parens: m << yield(f) David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!