Looking for Autocompletion field to replace select menu
I am looking to replace my select menu for my products inside of my form and wanted to know if anyone c开发者_高级运维an list choices or alternatives.
This is my select menu:
<%= select("price", "product_id", Product.all.collect {|p| [ p.name, p.id ]) %>
I want an autocomplete field to replace it instead. These are the choices so far:
Chosen
Jquery TokenInput
OK, so far we have two, anymore?
Thanks.
If you're looking for a client-side solution, Chosen is a very good jQuery plugin. It'll transform any select field into an drop-down with autocomplete.
Note that Chosen is actually disabled on iPhone, iPod Touch, and Android mobile devices, so if your site needs to support mobile, Chosen is not a valid option.
I believe this plugin should more than cover your needs.
https://github.com/crowdint/rails3-jquery-autocomplete
精彩评论