From: ahoward Date: 2003-04-02T00:46:37+09:00 Subject: Re: Amrita substitution question On Tue, 1 Apr 2003, Brian Candler wrote: > Any Amrita experts out there... not an 'expert' - but this might work : # What I want to do is: # (1) replace 'REPLACE ME ' with some text # (2) Conditionally keep the hyperlink, and set its href attribute ----CUT---- #!/usr/local/bin/ruby require 'amrita/template' include Amrita template = Amrita::TemplateText.new <<-html html data0 = { :item => { :text => 'Foo thing', :add => false, }, } template.expand $stdout, data0 data1 = { :item => { :text => 'Foo thing', :add => a(:href => "wibble.cgi?add=foo"){"(Add)"}, }, } template.expand $stdout, data1 template = Amrita::TemplateText.new <<-html html data = { :items => [data0, data1] } template.expand $stdout, data ----CUT---- -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================