CGI form method error

M

Milo Thurston

I've recently encountered this error:

[Wed Jun 02 14:10:19 2004] [error] [client 127.0.0.1]
/usr/lib/ruby/1.8/cgi.rb:1841:in `popup_menu': undefined method
`collect' for nil:NilClass (NoMethodError), referer:
http://localhost/~milo/cgi-bin/web_sfg.cgi

The offending code is the scrolling_list line in this block:

def get_genome(cgi,dbc)
cgi.form {
cgi.textarea('cols'=>'20','rows'=>'1','name'=>'get_genome') +
cgi.br +
cgi.scrolling_list('name'=>'get_database','values'=>dbc) +
cgi.br +
cgi.submit('value'=>'Bring me switches!')
}
end

dbc is an array like so:

[['swissprot',true],['nr']]

Is this a bug, or is my code somehow dodgy? I'd appreciate
a suggestion as to how to fix it, if so.
Thanks.
 
T

ts

Apparently it's case sensitive for #scrolling_list

M> cgi.br +
M> cgi.scrolling_list('name'=>'get_database','values'=>dbc) +

cgi.scrolling_list('NAME'=>'get_database','VALUES'=>dbc) +

M> cgi.br +



Guy Decoux
 
T

ts

M> Thanks - it seems that that affects a few other methods,
M> too, then.

#checkbox_group, #radio_group seems also case sensitive


Guy Decoux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cgi test failure. 2

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,199
Latest member
AnyaFlynn6

Latest Threads

Top