Generally I prefer chosen.js for static select list. It works out of the box simply by adding 'chosen-select' class to select tag. If your list is massivly big ajax-chosen.js is best choice. You can filer select result by sending search query to server when user start typing on the text box.
Actually, in my app
<option> field = number of patient added
Means as much as patient added, list gain it's size according to that
so, it seems 'ajax-chosen' works great for me.
Right now I'm playing with 'chosen' only. I'm facing little obstacle
in it, although it works like a charm but in order to work it properly
I have to refresh my page only then it come into effect. Else, if I
click on button and move to 'vital/new.html.erb' page it show simple
text field, once I refresh my page then it comes into effect. Any idea
I have followed this : https://github.com/tsechingho/chosen-rails
There is also typeahead-rails gem. It is also based on js solution which I haven't tried but worth for you to look at.
Surely, I'll check this out once I grab a hold on chosen.
You're running into the usual conflict with Turbolinks. Instead of using $(document).ready(...) (jquery) or document.on('dom:loaded', ...) (prototype), you have to listen for a different event in order to start your script:
$(document).on('page:change', ...) replaces $(document).ready(...) in jQuery, and document.on('page:change', ...) does the same in Prototype.