I'm using the jQuery plugin jQuery-Tokenizing-Autocomplete in a rails application with a has_many association.
I need to save the values to the database, but to do that I need it to be a string, not an array. So the result should equal "1","2","3". Hope this clarifies.
The javascript used to generate this array:
$.TokenList.ParseValue = function (value, settings) {
var result = [];
$.each(value, function(i, node) {
if (node) {
result.push(node.id);
}
});
return result;
};