From: Kirk Haines Date: 2004-02-04T04:06:10+09:00 Subject: Re: Ruby Web Application Framework Roundup On Wed, 4 Feb 2004, paul vudmaska wrote: > Amrita? kind of cook but i've tended to avoid template > systems. ruby scripting is (so easy/intuitive) maybe > just a little more sophisticated than a mark-up > language so why learn another? Maybe ERuby and just > sandbox a script/template? Well, for my purposes, Iowa _generally_ just uses regular HTML with an extra attribute, 'oid'. There are a few special tags like and , and a special bit of syntax where @WORD where calls the method WORD and inserts its return value. Also, one can insert other components by importing them and refering to them much like an HTML tag. So, a few differences from plain markup, but not much. And the net result is that I can do things like this:

Ad tag summary as of: @current_time

  • @tag
And then in the seperate code file, the code would be: <% class AdTagSummary < Iowa::Component attr_accessor :tag def current_time Time.now.to_s end def tags r = [] application.dbpool.getConnection do |dbh| sql = 'select distinct(origin_code) from ad_responses' dbh.select_all sql do |row| r.push row[0] end end r end end %> The code is cleanly seperated from the presentation, allowing one to muck with the presentation at will without worrying about the code, and the markup is just plain HTML with a few special things, so the learning curve is pretty low. Kirk Haines