From: Ryan Leavengood Date: 2005-06-21T06:32:38+09:00 Subject: Re: cgi question Boris Glawe said: > Hi, the following code results in NoMethodError, when being executed as a > cgi > script. > > The reason is the line "+ cgi.b {"hello world in bold"}" at the bottom. You are attempting to call the unary operator + on cgi.b, which returns a string. In Ruby's internals the unary + is actually the +@ method. This code works: require "cgi" cgi=CGI.new("html4") cgi.out { CGI.pretty( cgi.html{ cgi.head{ cgi.title{ "testpage" } } + cgi.body{ cgi.form{ cgi.table( {'border' => '1'} ){ cgi.tr { cgi.td{ "hello"} + cgi.td {"world"} } # end tr } # end table } +# end form <--NOTE WHERE THE PLUS IS cgi.b {"hello world in bold"} } # end head } # end html ) # end CGI#pretty } # end cgi.out Ryan