I have successfully set up acts_as_taggable_on my model. As expected, when I split the tags with commas, it splits the tags correctly.
However, when I edit the post the field is auto populated with the tags for editing, except the commas are now gone.
This means if I hit save without putting them back in, the tags now become all one tag.
I have tried using ActsAsTaggableOn.delimiter = ' '
which works when they are one word tags. But now I have the issue that if i have a two word tag, when I edit and save the post the two word tags now become one word tags.
Any help anybody might have on this would be greatly appreciated.
Thanks!
This behavior is apparently by design in acts_as_taggable_on.
Try adding to_s
to your tag_list in the form input:
<%= f.text_field :tag_list, value: @example_record.tag_list.to_s %>
Not ideal, but this should allow your field to display the comma separated tags properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With