How to post multiple rows into DB using ruby Grape. For example when testing with CURL this is working fine
curl -H "Content-Type: application/json" -X POST \
-d '{"name": "test", "age": "22"}' http://localhost:3000/students
But this is not working
curl -H "Content-Type: application/json" -X POST \
-d '[{"name": "test", "age": "22"}, {"name": "someone", "age": "32" }]' \
http://localhost:3000/students
This is my grape api code
post do
student = Student.new
student.name = params[:name]
student.age = params[:age]
student.save!
end