From: Tony De Date: 2008-03-18T12:58:41+09:00 Subject: Re: CGI and Methods?? Justin Collins wrote: > Tony De wrote: >> aid me in my learning process. Thank you very much. >> >> tonyd >> > > Writing code using the CGI library is just like any other Ruby code, so > you can have any methods, classes, or other code that you want. > >> puts "Content-type: >> text/plain\r\n\r\n\n\nCommSpeed Log >> Search\n\n\n" >> puts "

No DHCP Log Results Found!

" >> puts "\n\n" >> exit > > The CGI library does this kind of HTML work for you. See the example in > about the middle of the page here: > http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI.html > and the documentation here: > http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI/HtmlExtension.html > > > > -Justin Thanks Justin, That's what I thought. However, when I place a: def my_method end statement, my code dies. Even if I simply make the definition with no additional code. Do I need to place it at the top, bottom? And does it have something to do with the extension I place on the file, .cgi vs .rb? tonyd -- Posted via http://www.ruby-forum.com/.