From: Ryan Pavlik Date: 2003-09-13T05:17:08+09:00 Subject: Re: HTML generation On Sat, 13 Sep 2003 04:57:46 +0900 Philip Mak wrote: > Is there a list of all the different ways of outputting HTML in Ruby > somewhere? > > I can think of using the "puts" statement, eRuby, and CGI. Any others? > e.g.: > > "puts" statement: > > puts "

Hello, world! Your name is #{name}.

" > > eRuby: > >

Hello, world! Your name is <%=name%>.

> > CGI: > > cgi.puts { cgi.p { "Hello, world! Your name is #{cgi.b name}." } } I'll shamelessly plug Mephle here. I have an HTML widget set in there: colors = ["Red", "Green", "Blue"] t = Table.new f = Form.new f << table t << Row["Name:", TextBox.new] t << Row["Age:", TextBox.new] t << Row["Favorite Color:", OptionList[*colors]] t << Row["", Submit["Send"]] html = t.to_s(...) Outputs nicely-indented HTML, as much as possible, too. -- Ryan Pavlik "Must use last ounce of strength to stab from beyond the grave." - 8BT