[Nitro] Solved: OgAdminController#save is not the problem....

Robert Mela rob at robmela.com
Thu Nov 1 22:52:30 EDT 2007

Problem found.   The correct fix for OgAdminController#save is not in 
OgAdminController.  It's in Cgi#parse_params

Before a fix can be implemented there should be a decision as to whether 
post and get params should be hash or dictionary.  

Plain old POST request bodies are parsed using Cgi#parse_query_string ( 
sic ) and that returns a Dictonary:

  context.post_params = parse_query_string(data)

Multipart form data is parsed using Cgi#parse_multipart, which returns a 

    context.post_params = parse_multipart(context, boundary)

... and which also conveniently contains the comment


If a decision is reached that Dictionary is to be used for form data 
then the following initializations in Context#initialize would need to 
be changed:

    @post_params = {}
    @get_params = {}

So, having no shame, I'll ask a stupid question:  Why Dictionary for 
request params?   Also, does using Dictionary for some collection ( 
post/get params ) and Hash for others ( headers) risk being 
counterintuitive?  I think it's reasonable to think of headers and 
params as collections, and for a programmer to expect them to expose the 
same syntax.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071101/194fe6b0/attachment.vcf 

More information about the Nitro-general mailing list