← Back to Upcase

"Add new" option for collection select -- context: tagging

(Brian Dear) #1

given something like this:

= f.collection_select :tag_list, current_user.owned_tags(:name), :id, :name, {selected: false}, {multiple: true, "data-placeholder" => "Add tags to this document", class: 'tags-chosen-select', id: 'tag-list'}

It works fine if a tag already exists. However, What’s the best way to allow new tag adding on the fly, similar to how tagging works on work press? Is there a “Rails” way to do it?

(Carles Jove I Buxeda) #2

By this, do mean how to add tags to the collection of tags of the current user, current_user.owned_tags?