-
Notifications
You must be signed in to change notification settings - Fork 36
Description
It would be great if users could be allowed to enter a new custom that's not in the collection to search for.
Select2 seems to provide support for this via the "tagging" feature, but I'm unable to get it to work.
Thus far what I've tried:
filter(
:foo,
as: :searchable_select,
collection: ['bar'],
input_html: {
tags: true
}
)
I got this by looking at this SO answer https://stackoverflow.com/a/30021059
Original docs from Select2 on this feature:
https://github.com/select2/select2/blob/develop/docs/pages/09.tagging/docs.md
I don't need complex logic for new tags, nor really ajax lookups or anything like that. The problem is I have a long list of string values and in some cases users would like to search on a value that's not in my list. I could simply change it to a plain input, but it's nice have some suggested values to search on.
I'd be more than happy to contribute a solution, I'm just not sure where to start.