From: Tobias Reif Date: 2002-02-21T07:49:28+09:00 Subject: Re: Global variables, mod_ruby Dan McNulty wrote: > Yes I have considered it but I am not sure it facilitates clean > separation of HTML from Ruby. Does it work similarly to the regular > CGI stuff included in the Ruby distribution? > > My impression is that it requires an entirely different paradigm from > what I want to do: write pure Ruby that "prints" to a template thus > keeping HTML and code cleanly separated. > > Is there some example code around I can look at? I thought about doing it something like = = = = = = = = = = XHTML templates [...] or

[...]

= = = = = = = = = = then insert dynamic XHTML, generated by html_writer gallery_tree = Document.new gallery_template_string pics_para = XPath.first gallery_tree, "//p[@class='pics']" pics_rows = [] pics.each do |pic| tr = Tr.new tr.insert Td.new # ... pics_rows.push end pics_para.insert rows # here, data gets inserted into the template as dynamic XHTML Tobi -- * peace&love. * http://www.pinkjuice.com/