0

I have a simple form which uses jquery-tokeninput as shown in the code below (http://loopj.com/jquery-tokeninput/, https://github.com/loopj/jquery-tokeninput). Can I convert the form to use formtastic and keep the data attribute working? what should I do to replace data: {load: @product.tags} ?

<%= f.text_field :tag_tokens, data: {load: @product.tags} %>

1 Answers1

4

Something like this, using the input_html Hash:

<%= f.input :tag_tokens, input_html: { data: { load: @product.tags } } %>
Justin French
  • 2,867
  • 19
  • 14