0

In my form, I use JqueryTokenInput to add tags. When I fill the form and submit, usually, if there are errors the form will load again with the values I entered. But the TokenInput field won't get those values. I tried to do it by loading data from the params like this :

In the view input field :

  data: {load: @current_tags}

In the controller :

  @current_tags = params[:deshana][:deshanatag_list]

This doesn't work. I think its not in the right format. How can I do this?

THpubs
  • 7,804
  • 16
  • 68
  • 143

1 Answers1

0

Buddy i have also used the token input for the auto-complete drop down and here i have doing this which you have asked the question.

May this will defiantly help full for that to compelete your problem.

Write the following line in the start of your javascript tag on the html page.

$("#id_of_your_token_input_field").tokenInput(token_input_data,{

prePopulate: [{id: id_of_data, name:name_of_data}]

});
Bharat soni
  • 2,686
  • 18
  • 27