I'm using select2 for a multiple selector. Currently this is in my HTML file:
<%= form.select "page_request_set_ids", @multiautocomplete_set_options.unshift(""),
{}, id: "page-request-sets", multiple: true,
allowClear: true, data: {placeholder: "Start typing sets..."} %>
@multiautocomplete_set_options
is an array of strings.
When I go to access :page_request_set_ids
later, the strings I typed in are there, along with an empty string.
I've tried to remove the unshift("")
, which kept my placeholder, but did not remove the issue of the blank string in :page_request_set_ids
.
Any ideas?