I am having a model Movie that has tags, using the gem acts_as_taggable_on.
I can do this in the form: <%= form.text_input :tag_list %> and it works - it shows the tags associated with the movie, and I can add tags, separated by commas, all fine.
I am now trying to use a collection_select helper, and I had two ideas: using ":tag_ids" as first parameter, which makes DISPLAYING the tags assigned to movies properly (as selected), but not updated, or using ":tag_list" which makes tag updates work but not displaying...
<%= form.collection_select(:tag_list, @all_tags, :id, :name, { }, { class: 'font-size-m', id: 'tag-select', multiple: true }) %>
(I define @all_tags in the controller as follows):
@all_tags = ActsAsTaggableOn::Tag.all
Not sure how to use a collection_select with these tags... any help appreciated!
The problem actually was that I used :tag_list as permitted parameter and not tag_list: []. Turns out that depending on how you use acts-as-taggable-on - you either deal with a string (with comma separated values) or with an array. I am still not quite sure how exactly that works but - whenever tags are not saved now during my development, I first try to switch the permitted parameters :)