Rails autocomplete the question of removing extraneous information
I have my autocomplete plugin that works great ... except that I have certain information that I want to display in the autocomplete div, but I donβt want the user to make a selection.
Ie .... I have autocomplete for currencies ... they can search by currency code or by country ... as it searches for them it displays both information and country flag.
the form:
<%= text_field_with_auto_complete :currency, :from, { :size => "10", :value => "USD" }, :skip_style => true %>
Partial:
<li class="currency"><div class="image"><img src="/images/flags_currency/<%=h code %>.png"/></div><div class="name"><%=h code %></div><div class="country"> <%=h other %></div></li>
But after selecting them, I would like this to not put the country name in the field, would I like to somehow edit it using javascript or CSS?
Any ideas?
+2
source to share
1 answer
What about:
text_field_with_auto_complete :currency, :from,
{ :size => "10", :value => "USD" },
:skip_style => true, :select => :name
From the parameters auto_complete_field
.
+3
source to share