0

If you go here, and click in the search box for the field 'Where' and choose any of the options, you will see that they get added to the field and you can continue adding terms to the 'where' field.

I implemented search functionality in it's own model, similar to what Ryan Bates covered in this Railscast.

I am not quite sure how to get the search suggestion & multi-select functionality working. Any ideas or links to either any tutorials or Railscasts or just a general suggestion about how I might implement this?

Thanks.

P.S. I can view the autocomplete Railscast but that doesn't cover the multi-select aspect.

marcamillion
  • 32,933
  • 55
  • 189
  • 380

1 Answers1

5

In AutoSuggest jQuery Plugin, Drew Wilson nicely illustrated How to implement multi-select using AutoSuggest with example: "How to Use it and How it Works".

sjain
  • 23,126
  • 28
  • 107
  • 185
  • Hrmm...the issue with this is that this implements autosuggest for only 1 field per selector, right? As in, will it allow me to input say 4 different items in my one field? E.g. say I want to type in "Mick Jagger", "Johnny storm" and "Richard Hatch" all in 1 field. Will this allow me to do that? – marcamillion Feb 12 '13 at 11:55
  • This will work for all comma seperated fields. When you make a selection the item is added to the input box. Also there is a hidden input field generated for each AutoSuggest box that stores the values (comma separated) of each item you have selected. This input box will have a unique ID as well as a class name of "as-values". – sjain Feb 12 '13 at 12:06
  • @RyanAngilly - Thanks for notifying. I have updated the link in the answer. Now it is working.. :) – sjain Jan 28 '16 at 06:53
  • Woohoo! Thank God! ;) – Ryan Angilly Jan 28 '16 at 18:09