This tokeninput is from http://loopj.com/jquery-tokeninput/
I see the tutorial from http://railscasts.com/episodes/258-token-fields-revised
As i am using it in many places i need sometime only one value selection while in others multiple values. It is the code for multiple value selction. Now i want it to search only once and submit only one value. Is there any way to code it in my coffescript file to select only one value and stop?
my code for customers.js.coffee
jQuery ->
$('#customer_plan_tokens').tokenInput '/plans.json'
theme: 'facebook'
prePopulate: $('#customer_plan_tokens').data('load')
my code for _form.html.erb for cusomers is
<div class="form-inputs-right">
Projects: <%= f.text_field :plan_tokens, data: {load: @customer.plans}, :label => "Projects" %>
</div>