[Nitro] Request#params
Robert Mela
rob at robmela.com
Sun Sep 30 22:29:42 EDT 2007
A second, related question --
OgAdminController#save attempts to access request data via the 'request'
method call:
klass = name_to_class(*request*['object_class_name'].to_s)
obj.assign(*request*, :assign_relations => true, :force_boolean => true)
A couple problems
- Major misnomer: request returns a @context object
- @request does not have a [] method for accessing incoming request
variables ( nor should it...)
I've worked around it for now by calling
@context.post_params['object_class_name'] .... which led up to the
question in my prev. email, since @context.params would be nicer...
Robert Mela wrote:
> Not sure what the intent is here in request.rb, module Raw, included
> in class Context
>
> 31 def params
> 32 if method == :post
> 33 @post_params.instance_variable_get("@hash")
> 34 else
> 35 @get_params.instance_variable_get("@hash")
> 36 end
> 37 end
>
>
> @post_params is itself a hash and an instance variable on Context,
> and @post_params.instance_variable_get( "@hash" ) returns nil.
>
> Anything wrong with doing this instead?
>
> 31 def params
> 32 return method == :post ? @post_params : @get_params
> 33 end
>
> If that's acceptable I'll add it to the patches I'm preparing.
>
> thx.
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
-------------- 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/20070930/b3ca10ec/attachment.vcf
More information about the Nitro-general
mailing list