List Info

Thread: params




params
user name
2006-10-30 09:55:14
Jonathan,

I worked a bit with your patch. I have twor problems:

- the code barks with non english (for example greek ) params

  for example my_action/GREEK_PARAM does not get unescaped
correctly.
  but I can find a solution for this.

- I would like the current behaviour:

  def my_action(oid, val)
  end

  should handle bothP

 my_action/1/23

 and

 my_action?oid=1;val=23

 even though the params are not ordered as hash (though we
can use a
dictionary here) the query string is ordered and it makes
the
my_action implementation cleaner (ie i can use oid instead
of
request['oid'])

 moreover I really want to use my_action?oid=1;val=23
instead of the
nice url. I only want to use niceurls in links. I want to
use normal
query strings in 'actions' and rest/programmatic request.

can you somehow adapt your code to handle the second
problem?
Moreover, could you add a separation of get/post parameters?

thanks,
George.


-- 
http://www.gmosx.com
http://www.nitroproject.o
rg
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
params
user name
2006-10-30 14:36:30
Hi,

> I worked a bit with your patch. I have two problems:

Was to be expected. ;D

> - the code barks with non english (for example greek
)
params 
>   for example my_action/GREEK_PARAM does not get
unescaped correctly.
>   but I can find a solution for this.

Hmm.. I got no idea how to work with other languages, good
that you
do this.  ;D

>  even though the params are not ordered as hash (though
we can use a
> dictionary here) the query string is ordered and it
makes the
> my_action implementation cleaner (ie i can use oid
instead of
> request['oid'])

Reworked cgi.rb parameter parsing to use Dictionary.

>  moreover I really want to use my_action?oid=1;val=23
instead of the
> nice url. I only want to use niceurls in links. I want
to use normal
> query strings in 'actions' and rest/programmatic
request.

> can you somehow adapt your code to handle the second
problem?

Configurable:

Nitro::Compiler.setting :mixin_get_parameters, :default
=> false


> Moreover, could you add a separation of get/post
parameters?

Lets do this next release, will add this to my todo list.

As an extra:

Nitro::Compiler.setting :non_strict_action_calling, :default
=> false

This can be used to configure if `def my_action(oid, val)`
should be
treated as `def my_action(oid = nil, val = nil)`.

I thought after all that disagreement that perhaps a setting
is best.
Just don't touch the default!  ;D

Oh right, and the testcases for these two new functions have
to be
increased, I only added 1 per setting.

[Bounty]
So, anyone here up for some testcase adding?  It's quite
easy work
and can be done by someone new wanting to get a little into
the
Nitro code.  Just add more tests and look how it gets
handled and
if it's correct what it does.  (For example, try with more
params,
less params, incomplete params, mixed params/action-params,
param
mixing together with non-strict action calling.  etc.)

George, a little thought.  How can we test for correctly
unescaped
paramets (any more places where this could go wrong?)? 
Would be great
if you could add a little testcase somewhere appropriate.

Have a nice day everyone. 

Jonathan

-- 
Feel the love
http://pinkjuice.com/pics/ruby.
png_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
params
user name
2006-10-30 14:36:30
Hi,

> I worked a bit with your patch. I have two problems:

Was to be expected. ;D

> - the code barks with non english (for example greek
)
params 
>   for example my_action/GREEK_PARAM does not get
unescaped correctly.
>   but I can find a solution for this.

Hmm.. I got no idea how to work with other languages, good
that you
do this.  ;D

>  even though the params are not ordered as hash (though
we can use a
> dictionary here) the query string is ordered and it
makes the
> my_action implementation cleaner (ie i can use oid
instead of
> request['oid'])

Reworked cgi.rb parameter parsing to use Dictionary.

>  moreover I really want to use my_action?oid=1;val=23
instead of the
> nice url. I only want to use niceurls in links. I want
to use normal
> query strings in 'actions' and rest/programmatic
request.

> can you somehow adapt your code to handle the second
problem?

Configurable:

Nitro::Compiler.setting :mixin_get_parameters, :default
=> false


> Moreover, could you add a separation of get/post
parameters?

Lets do this next release, will add this to my todo list.

As an extra:

Nitro::Compiler.setting :non_strict_action_calling, :default
=> false

This can be used to configure if `def my_action(oid, val)`
should be
treated as `def my_action(oid = nil, val = nil)`.

I thought after all that disagreement that perhaps a setting
is best.
Just don't touch the default!  ;D

Oh right, and the testcases for these two new functions have
to be
increased, I only added 1 per setting.

[Bounty]
So, anyone here up for some testcase adding?  It's quite
easy work
and can be done by someone new wanting to get a little into
the
Nitro code.  Just add more tests and look how it gets
handled and
if it's correct what it does.  (For example, try with more
params,
less params, incomplete params, mixed params/action-params,
param
mixing together with non-strict action calling.  etc.)

George, a little thought.  How can we test for correctly
unescaped
paramets (any more places where this could go wrong?)? 
Would be great
if you could add a little testcase somewhere appropriate.

Have a nice day everyone. 

Jonathan

-- 
Feel the love
http://pinkjuice.com/pics/ruby.
png_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )