我在 Rails 3 中有这个 POST参数(来自 Google 购物车脚本)。
{
"shopping-cart.items.item-1.item-name"=>"Item one",
"shopping-cart.items.item-1.item-description"=>"An item",
"shopping-cart.items.item-1.unit-price"=>"10",
"shopping-cart.items.item-1.unit-price.currency"=>"GBP",
"shopping-cart.items.item-1.quantity"=>"1",
"shopping-cart.items.item-2.item-name"=>"Item two",
"shopping-cart.items.item-2.item-description"=>"Another item",
"shopping-cart.items.item-2.unit-price"=>"12.5",
"shopping-cart.items.item-2.unit-price.currency"=>"GBP",
"shopping-cart.items.item-2.quantity"=>"3",
"shopping-cart.items.item-3.item-name"=>"Item three",
"shopping-cart.items.item-3.item-description"=>"Yet another item",
"shopping-cart.items.item-3.unit-price"=>"20",
"shopping-cart.items.item-3.unit-price.currency"=>"GBP",
"shopping-cart.items.item-3.quantity"=>"2",
"edit_url"=>"http://somerailsapp/store/buy",
"_charset_"=>"UTF-8",
"controller"=>"order",
"action"=>"process"
}
将其转换为明显哈希的最有效方法是什么?