CGI for creating a web page : HTML « CGI « Ruby






CGI for creating a web page


#!/ruby/bin/ruby
require 'cgi'
cgi=CGI.new("html3")
cgi.out{
     cgi.html{
            cgi.head{cgi.title{"My First Page"}}
            cgi.body{cgi.h1{"Hello, Welcome to the World of Ruby"}}
            }
     }

 








Related examples in the same category

1.CGI.escape and CGI.unescape.
2.CGI.escapeHTML
3.CGI.escapeElement
4.CGI.unescapeHTML
5.Generating HTML
6.Output a string to web
7.nested cgi.tag to create HTML document
8.Create a hash of HTTP response headers