From: Joshua Ballanco <jballanc@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Checkbox selection trouble in request.params
Date: Fri, 15 Jun 2012 18:58:17 +0300 [thread overview]
Message-ID: <756F637E9A3B4B889225D9A1E3C9111C@gmail.com> (raw)
In-Reply-To: <7bc991c7-3719-44ca-91d0-e9caeaf8d547@z4g2000pbz.googlegroups.com>
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
You've only passed one parameter. The first "foo=1" sets the foo parameter to 1. The second "foo=3" re-assigns foo to 3. If you want two parameters to be passed to your app, you need to define two separate parameters.
On Wednesday, June 13, 2012 at 10:55 AM, Randy M wrote:
> Hello everyone.
>
> I'm using rack (1.4.1), but it seems cannot receive
> checkbox selection value..
>
> http://localhost/hello.cgi?foo=1&foo=3
> Hello, Rack
> {"foo"=>"3"}
>
> Code below.
>
> #!ruby
> require "rack"
> class HelloRack
> def call(env)
> req = Rack::Request.new(env)
> return [200, {"Content-Type" => "text/plain"},
> "Hello, Rack\n" + req.params.inspect ]
> end
> end
> Rack::Handler::CGI.run HelloRack.new
>
> Could anyone tell me idea?
>
>
> ----------
> Randy Michaels
> randy_michaels@aol.com (mailto:randy_michaels@aol.com)
>
>
[-- Attachment #2: Type: text/html, Size: 1768 bytes --]
next prev parent reply other threads:[~2012-06-15 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 7:55 Checkbox selection trouble in request.params Randy M
2012-06-15 15:58 ` Joshua Ballanco [this message]
2012-06-15 17:15 ` Randy M
2012-06-15 17:11 ` Silviu Rusu
2012-06-16 8:13 ` Randy M
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=756F637E9A3B4B889225D9A1E3C9111C@gmail.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).