from this
["{\r\n \"charge_type\": \"sports\",\r\n \"amount\": 1000\r\n},{\r\n \"charge_type\": \"servicing\",\r\n \"amount\": 550\r\n}"]
to this
[{"charge_type"=>"sports", "amount"=> "1000"},{"charge_type"=>"servicing", "amount"=> "500"}]
I have tried this,
JSON.parse(["{\r\n \"charge_type\": \"sports\",\r\n \"amount\": 1000\r\n},{\r\n \"charge_type\": \"servicing\",\r\n \"amount\": 550\r\n}"].first)
But could not figure it out. Any help will be appreciated.
[ ... ]. For some reason you've done that external to the JSON string.