From: gabriele renzi Date: 2005-04-17T23:19:34+09:00 Subject: Re: Html Tag Generation Karsten Meier ha scritto: > There ruby solution has two problems: > 1) because the methods like CGI::li() take a block as parameter, we can not > use a list as content parameter: > cgi.li{%w(red blue green)} returns "
  • redbluegreen
  • " instead of > "
  • red
  • blue
  • green
  • " > > 2) we need to write cgi.li{..} instead of just li(..) > The result is that the scripts looks more confusing than the solution > with perls cgi module. > (In most other cases the ruby solutions looks better) > > So my questions are: > Are there better ways to use the cgi module which I'm not aware of? > Or is there a better module to use for html generation, preferable in > the standard lib? > > > Regards > > Karsten Meier > > alternatively you could use: >> require 'cgi' => true >> include CGI::Html3 # Html4 or whatever => Object >> element_init() => nil >> ol{'foo'} => "
      foo
    " which is even more confusing maybe.. B ut makes me think: maybe the element_init should be called on the various HTML mixins #included and #extended methods ?