新手问题 怎么接受 url 中相同的参数

xiaoxiao · June 06, 2013 · Last by xiaoxiao replied at June 12, 2013 · 2884 hits

url 的格式如下 id=&suppliers=yi&suppliers=ti&comment=1,有两个相同的 suppliers 参数 ,在 ruby 的 controller 中怎么接收这两个数据 params[suppliers]

suppliersp[]=1&suppliersp[]=2 Parameters: {"suppliersp"=>["1", "2"]}

这样的查询串用 params 只能得到一个。

只能自己解析。

2 楼正解 如果改不了 那应该是只能用字符串处理的方式截取了

You need to Sign in before reply, if you don't have an account, please Sign up first.