On 17/08/2009, at 12:16 PM, MarkBennett wrote:
> Is there a way to change which parameter seperators are significant to
> Rails?
If you're using the latest version of Rails, it uses Rack for
parameter parsing. Specifically, the method
Rack::Utils#parse_query(query_string, separators). The second argument
to that method is "&;" by default, which is why the params hash is
being parsed the way it is. If you pass "&" as the second parameter,
things should work as you expected:
> irb -r "rubygems" -r "rack/utils"
> >>
> Rack
> ::Utils
> .parse_query("tqx=key1:value1;key2:value2&normalparam=normalvalue")
> => {"key2:value2"=>nil, "normalparam"=>"normalvalue",
> "tqx"=>"key1:value1"}
> >>
> Rack
> ::Utils
> .parse_query("tqx=key1:value1;key2:value2&normalparam=normalvalue",
> "&")
> => {"normalparam"=>"normalvalue", "tqx"=>"key1:value1;key2:value2"}
Cheers,
Nathan de Vries
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---