Updated question for clearer understanding!
I'm currently working on an Angular-Rails application and facing challenges when it comes to parsing an array. One of my ActiveRecord models has an attribute that is an array. Before reaching my Angular app, the array appears like this in my Rails controller:
def show
@thing = Thing.find(params[:id])
# @thing.list => ["{\"content\"=>\"first index\"}", "{\"content\"=>\"second index\"}"]
render json: @recipe
end
# resulting JSON for @thing:
{
id: 1,
title: "thing",
list: [
"first index",
"second index"
],
}
Upon entering my angular controller, the array attribute is displayed as:
thing.list => ["{"content"=>"one"}", "{"content"=>"two"}"]
The desired format should be:
[{content: "one"}, {content:"two"}]
I have attempted using JSON.parse on both the Rails and Angular sides of the application, but unfortunately, it did not yield the expected results.