I'm trying to implement x-editable into my Rails project and I want to use a list of participants that come from my DB as the source of a 'Select' question.
I've read the documentation and it states that the Source option accepts an array of objects, so I'm formatting this list accordingly. Unfortunately, the 'Select' field appears blank as if the source was not really recognized.
Since I'm using x-editable-rails gem to implement I thought it was a problem on how the gem was rendering the HTML data attributes. However, when I inspected the element in my browser console I don't see what's the problem.
My rendered HTML
<span class="editable editable-click editable-empty" title="Participant" data-type="select" data-model="answer" data-name="participant_id" data-value="" data-placeholder="Participant" data-source="[{"id":1,"username":"Shari","created_at":"2017-08-15T11:23:26.692Z","updated_at":"2017-08-15T11:23:26.692Z"},{"id":2,"username":"Mireya ","created_at":"2017-08-15T11:23:41.760Z","updated_at":"2017-08-15T11:23:41.760Z"},{"id":3,"username":"Edgar ","created_at":"2017-08-15T11:23:53.356Z","updated_at":"2017-08-15T11:23:53.356Z"}]" data-url="/answers/2">Empty</span>
x-editable Documentation advice
[{value: 1, text: "text1"}, {value: 2, text: "text2"}, ...]
Could you advise on a potential solution?