loopj/jquery-tokeninput — Issue #284: jQuery tokeninput text_field overlap in the first iteration
Author: grujildo
Created: 2012-03-02 13:46:10+00:00
State: open

I am using jQuery - tokeninput 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 want to add new tags with this plugin, but how can I insert new tag, that is not in the tag list?