将多维数组传递给 rails 控制器时,它似乎无法正确解析。我做错了吗?
url: http://localhost:3000/people?sort[][]=lastname&sort[][]=1&sort[][]=firstname&sort[][]=1
params: {
"sort" => [
[0] nil,
[1] nil,
[2] nil,
[3] nil
],
"action" => "index",
"controller" => "people"
}
应该:
params: {
"sort" => [
[0] => [
[0] => 'lastname',
[1] => 1
],
[1] = > [
[0] => 'firstname',
[1] => 1
]
],
"action" => "index",
"controller" => "people"
}