1

When we press @ key in the text field, there will be a list of available option nearby the cursor, which is similar in twitter or stackoverflow. I've installed the auto_complete plugin from jquery ui, but I'm not sure whether it's available in my case.

Rida
  • 133
  • 3
  • 11

1 Answers1

0

The jQuery autocomplete should work just fine. You just need to give it a list to autocomplete from, or you can set it up to query the database over ajax for larger lists.

See a bit of a walkthrough here: How to set-up jquery-ui autocomplete in Rails

More info on an autocomplete gem here: https://github.com/crowdint/rails3-jquery-autocomplete And an example app here: https://github.com/crowdint/rails3-jquery-autocomplete-app

Community
  • 1
  • 1
Tyler
  • 11,272
  • 9
  • 65
  • 105
  • Thanks for your information. But I think my need is a little different. For example in the input field, I can submit the whole content to the server to get the result, which is similar with the use of auto complete. But what I want is when I press @te, the ajax will send the te as the search term. and it won't send other term. At the same time, I can @ @ @ several times. – Rida Aug 20 '13 at 06:19
  • Got it. In that case you should be able to make something out of these two jsfiddles: http://jsfiddle.net/BfAtM/2/ & http://jsfiddle.net/Vmes9/6/ – Tyler Aug 20 '13 at 16:25