mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/cgi.rb: CGI example for HTML generation
Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
088b04e8a4
commit
90d43225eb
2 changed files with 23 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Nov 30 14:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
|
||||
|
||||
* lib/cgi.rb: CGI example for HTML generation
|
||||
Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465]
|
||||
|
||||
Fri Nov 30 13:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
|
||||
|
||||
* time.c: Documentation improvements, grammar and formatting
|
||||
|
|
26
lib/cgi.rb
26
lib/cgi.rb
|
@ -234,22 +234,26 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
|
|||
# === Print http header and html string to $DEFAULT_OUTPUT ($>)
|
||||
#
|
||||
# require "cgi"
|
||||
# cgi = CGI.new("html3") # add HTML generation methods
|
||||
# cgi.out() do
|
||||
# cgi.html() do
|
||||
# cgi.head{ cgi.title{"TITLE"} } +
|
||||
# cgi.body() do
|
||||
# cgi.form() do
|
||||
# cgi = CGI.new("html4") # add HTML generation methods
|
||||
# cgi.out do
|
||||
# cgi.html do
|
||||
# cgi.head do
|
||||
# cgi.title { "TITLE" }
|
||||
# end +
|
||||
# cgi.body do
|
||||
# cgi.form("ACTION" => "uri") do
|
||||
# cgi.p do
|
||||
# cgi.textarea("get_text") +
|
||||
# cgi.br +
|
||||
# cgi.submit
|
||||
# end
|
||||
# end +
|
||||
# cgi.pre() do
|
||||
# cgi.pre do
|
||||
# CGI::escapeHTML(
|
||||
# "params: " + cgi.params.inspect + "\n" +
|
||||
# "cookies: " + cgi.cookies.inspect + "\n" +
|
||||
# ENV.collect() do |key, value|
|
||||
# key + " --> " + value + "\n"
|
||||
# "params: #{cgi.params.inspect}\n" +
|
||||
# "cookies: #{cgi.cookies.inspect}\n" +
|
||||
# ENV.collect do |key, value|
|
||||
# "#{key} --> #{value}\n"
|
||||
# end.join("")
|
||||
# )
|
||||
# end
|
||||
|
|
Loading…
Add table
Reference in a new issue