diff options
author | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-25 20:15:54 +0000 |
---|---|---|
committer | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-25 20:15:54 +0000 |
commit | d72045fe5d3f102860b588adf80c27135a18b679 (patch) | |
tree | 4c3b567d893b402f8b3073bc5a859ec52888a09d /lib/cgi.rb | |
parent | 1be4dfdf2969f095f2bdd2a0e119088871ab105a (diff) | |
download | ruby-d72045fe5d3f102860b588adf80c27135a18b679.tar.gz ruby-d72045fe5d3f102860b588adf80c27135a18b679.tar.xz ruby-d72045fe5d3f102860b588adf80c27135a18b679.zip |
* lib/cgi.rb (CGI#form): fix ruby-bugs-ja:PR#280, add default action.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi.rb')
-rw-r--r-- | lib/cgi.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 7870c8125..714a3a209 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -1253,7 +1253,7 @@ convert string charset, and set language to "ja". The hash keys are case sensitive. Ask the samples. =end - def form(method = "post", action = nil, enctype = "application/x-www-form-urlencoded") + def form(method = "post", action = script_name, enctype = "application/x-www-form-urlencoded") attributes = if method.kind_of?(String) { "METHOD" => method, "ACTION" => action, "ENCTYPE" => enctype } @@ -1273,9 +1273,13 @@ The hash keys are case sensitive. Ask the samples. end if @output_hidden hidden = @output_hidden.collect{|k,v| - "<DIV><INPUT TYPE=HIDDEN NAME=\"#{k}\" VALUE=\"#{v}\"></DIV>" + "<INPUT TYPE=HIDDEN NAME=\"#{k}\" VALUE=\"#{v}\">" }.to_s - body += hidden + if defined? fieldset + body += fieldset{ hidden } + else + body += hidden + end end super(attributes){body} end |