Rails acts-as-taggable-on with select2 (and simple_form)

后端 未结 3 1430
梦毁少年i
梦毁少年i 2021-01-05 09:18

I would like to have a select2 dropdown of tags, where i could select multiple existing tags and add new ones.

I have tried many different ways and i either don\'t g

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 09:44

    As I mentioned before, normal select2 library now uses only select input types, but it does work with input types when using select2-full library.

    So, this was a way out of one problem.

    Still I had problems with only passing one single value. I was actually copy/pasting code from one of the examples and it was wrong. It was stated that strong parameters should include :tag_list, which is obvious, but it is actually {tag_list[]} that was needed in order to accept all the values.

    Works like a charm now.

提交回复
热议问题