From: "Ara.T.Howard" Date: 2003-12-25T08:56:54+09:00 Subject: Re: amrita question On Wed, 24 Dec 2003, Carl Youngblood wrote: > Date: Wed, 24 Dec 2003 05:17:38 GMT > From: Carl Youngblood > Newsgroups: comp.lang.ruby > Subject: amrita question > > I'm having a weird problem with amrita. I need to have the contents of > a tag attribute be dynamically generated. So, if my template file has: > >
> ... >
amrita is very smart, if you do not specify new content it does not delete what's already there. combine that with the ability to replace attributes and you can do exactly what you want: ~ > cat /tmp/foo.rb require 'amrita/template' include Amrita t = TemplateText.new <<-html
html t.expand STDOUT, :form => a(:action => 'myform.cgi') ~ > ruby /tmp/foo.rb
cheers. -a -- ATTN: please update your address books with address below! =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | STP :: http://www.ngdc.noaa.gov/stp/ | NGDC :: http://www.ngdc.noaa.gov/ | NESDIS :: http://www.nesdis.noaa.gov/ | NOAA :: http://www.noaa.gov/ | US DOC :: http://www.commerce.gov/ | | The difference between art and science is that science is what we | understand well enough to explain to a computer. | Art is everything else. | -- Donald Knuth, "Discover" | | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' ===============================================================================