ruby on rails - jQuery: Select2 Not disabling previously chosen values -


i have array using select2 on same values picked multiple times. there way enable functionality? code below:

#home.js $(document).ready(function(){      $("#productdropdown").select2({         allowclear: true,         placeholder: "select product..."     }); }); 

then in view

#index.html.erb <%= form_tag manuals_path, method: :post, remote: true %>     <%= form_tag manuals_path, method: :post, remote: true %>     <%= select_tag :device, options_from_collection_for_select(@products, :id, :full_name), id: "productdropdown", multiple: true %>     <%= submit_tag 'create mymanual', class: 'submit', id: "generate" %> <% end %> 

and in controller

  def index     @products = product.usable   end 


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -