Support for Select2 tagging
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.
Sorry for being super late to respond. The activeadmin-select2 gem - which this gem is based on - appears to have some support for Select2 tags: https://github.com/mfairburn/activeadmin-select2/blob/master/lib/formtastic/inputs/select2_tags_input.rb. If you do not need the Ajax aspects, maybe using that might be a good fit?