[Nitro] request parameters

Chris Farmiloe chris at motionpath.com
Tue Nov 22 10:38:58 EST 2005


yeah i think the idea is that you could group separate objects
together for one request just using the naming.

example (pseudo html)

<form action="/process">
<input name="Article.name" />
<input name="Article.body" />

<input name="Comment.user_name" />
<input name="Comment.text" />
</form>

then from the /process method call something like

Article = Property.populate_object(Article.new, @params['Article'])
Comment = Property.populate_object(Comment.new, @params['Comment'])

and we would have our two objects full off nice form data
ready for use.

I'm not sure I agree that the values should be duplicated with their
full names in the request/params hash. I don't think it is much
to ask that some conventions be followed in naming, _'s would
visibly tie in with ruby's variables tighter too.

cat_and_dog looks nicer too ;-)

I would like to see further nesting of the "." hashed names...
ie. cat.and.dog ----> @params['cat']['and']['dog']
since as it currently stands I think my example above would break if  
I had
a Time or Date property :)




Chris Farmiloe
Design & Development.

Motionpath Digital Media Ltd.
St Georges road, Brighton, BN2 1ED.
Office: 01273 608708    |    Mobile:    07791 179481




On 22 Nov 2005, at 15:00, Tim Larson wrote:

> Periods '.' in request parameter names are handled specially
> by nitro, such that you cannot retrieve the value of a param
> named 'cats.and.dogs' via request['cats.and.dogs'] but instead
> you must use request['cats.and']['dogs'] (hope I got that right.)
> This might be really handy in some situations, but I would
> really like to also be able to retrieve via the full param name.
>
> --Tim Larson
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20051122/993a0a2f/attachment.html 


More information about the Nitro-general mailing list