分開後,我有一個導軌對象的字符串,例如:Rails的轉換模型與逗號
Book {id:1, name: "name1"}
Book {id:2, name: "name2"}
我使用DataTables和最好的ajax數據是得到對象作爲一個字符串數組,沒有列名。
我怎樣才能改變Book.all
數據的陣列,而不列名
預期的結果是這樣的
感謝
{
"data": [
[
"Tiger Nixon",
"System Architect",
"Edinburgh",
"5421",
"2011/04/25",
"$320,800"
],
[
"Garrett Winters",
"Accountant",
"Tokyo",
"8422",
"2011/07/25",
"$170,750"
],
[
"Ashton Cox",
"Junior Technical Author",
"San Francisco",
"1562",
"2009/01/12",
"$86,000"
]
]
}