I have an attribute on one of my models that is an array of string urls. I would like to edit this with a text field for each item in the array, with the ability to add or remove items. Has anyone done this before?
I don’t believe I can edit the array directly, so my guess is I need to map the array to an array of objects, e.g.
[
{ url: 'http://www.example.com', index: 0 },
{ url: 'http://www.example.com', index: 1 },
{ url: 'http://www.example.com', index: 2 }
]
And then map back to an array of strings before saving. However, I am not sure how to implement this. Any input or advice would be much appreciated!