From: Dennis Roberts Date: 2004-12-22T08:01:38+09:00 Subject: Re: html form generation problems This works! Thanks. What is the difference between each and collect? With each it still didn't work, but it did with collect. Thank you for your quick response. why the lucky stiff wrote: > You'll need to concatenate the various strings together to get this to > work. You might also consider using instance_eval to simplify things. > > #!/usr/bin/ruby -w > require 'cgi' > cgi = CGI.new("html3") > > ary = %w( one two three ) > > cgi.instance_eval do > out do > html do > head do > title { "Form Test" } > end + > body do > form do > ary.collect do |value| > text_field value, value > end.join + submit > end > end > end > end > end > > _why > >