vdepizzol/jquery-tokeninput — Issue #18: jQuery tokeninput text_field overlap in the first iteration
Author: grujildo
Created: 2012-03-02 13:34:51+00:00
State: open

I am using jQuery - tokeninput(vdepizzol) plugin with rails 3. And i have a problem, if event_criteria is_free I use jQuery tokeninput to introduce tags in tag_tokens field, but the problem is the tokeninput fields are overlaped in the first subscription_preference object. if I have 2 subcription_preferences, the two tokeninput fields are overlapped in the first one and the second subcription_preferences object have a simple text_field without tokeninput. This is my code:

<% @subscription.subscription_preference.each do |subscription_preference| %>
<%
eventCriteria = EventCriteria.find_by_id(subscription_preference.event_criteria_id)
if eventCriteria.is_free? %>

<% form_for subscription_preference do |f| %>

<%= f.label :tag_tokens, eventCriteria.name+"(Nueva gestion)" %>
<%= f.text_field :tag_tokens, "data-pre" => subscription_preference.tags.map(&:attributes).to_json %>

<%= f.submit "Save preference", :disable_with => 'Saving preference...' %>

<% end %>
<% end%>
<% end%>

How can I correct it?
I also have other problem, I put allowCustomEntry: true and I can add custom tag in the text_field but when I submit it it gives me this error "Couldn't find Tag with ID=0".