managed to submit a simple array to my grape api following this tip
testing rails grape API with curl, params array
Building a simple workout tracker that generates a graph at the end, through this array of workouts, which should be passed with their keys I guess.
But since what i'm trying to do is a 2D array, i have this output, the type is set to Array[Array], this is the call that i'm currently using
curl --data 'workouts_array[]=1&workouts_array[]=2&workouts_array[]=3' http://localhost:3000/api/v1/workouts/workout.json
And it returns
{
"workouts_array": [
[
"1"
],
[
"2"
],
[
"3"
]
]
}
But i wish to pass something like workouts_array[]=[1][2][3]&workouts_array[]=[4][5][6]
so it returns
{
"workouts_array": [
[
"time": "1", "distance": "2", "calories": "3",
],
[
"time": "4", "distance": "5", "calories": "6",
]
]
}
Thank you for any help, I guess it's just my poor way of using curl