I would like to create a select with your attributes(select id,select class) coming from JSON (that it's defined in my controller).
There is a way to do that? Or Does I need to do dynamic partials with the code of the select?
Assuming I do not know what attributes I have in JSON.
Thanks!
UPDATE:
For example, if I have this JSON:
{ "topology" : [
{ "name": "id", "value":"topology_id" },
{ "name": "class", "value": "topology_class1 topology_class2" },
{ "name": "diasbled", "value": "disabled" }
]
}
I would like to obtain this select tag:
<select id="topology_id" class="topology_class1 topology_class2" disabled="disabled"></select>
And if I have another JSON with another attributes, then these another attributes that will be in my select tag.