if(env['REQUEST_METHOD'] == 'POST')
$post = {}
post = env['rack.input'].read.split('&')
post_split = Array.new
post.each{|x| post_split << x.split('=')}
post_split.each{|x|
$post[x[0]] = x[1]
}
end
What would be a nice way to do this? I have a string like:
"a=b&c=d"
and i'm trying to get it into a hash like
{:a=>'b',:c=>'d'}
This code works but it is just terrible, and I can't access the keys with
$post[:a]
only
$post['a']