Convert JSON String to JSON Array in rails?

前端 未结 3 845
谎友^
谎友^ 2021-02-01 14:58

I have a JSON string in rails as shown below:

[{\"content\":\"1D\",\"createdTime\":\"09-06-2011 00:59\"},{\"content\":\"2D\",\"createdtime\":\"09-06-2011 08:00         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 15:49

    ActiveSupport::JSON.decode(string) will decode that for you into a delicious consumable object on the server side.

提交回复
热议问题