Dear all
I am reading a rails cookbook about the auto_complete_for function, the
code as below
app/controllers/musicians_controller.rb:
class MusiciansController < ApplicationController
auto_complete_for :musician, :name
def index
end
def add
# assemble a band…
end
end
app/views/musicians/index.rhtml:
Musician Selection
<% form_tag :action => :add do %>
<%= text_field_with_auto_complete :musician, :name %>
<%= submit_tag ‘Add’ %>
<% end %>
My question is that, if the name attribute consists lots of duplicated
values, how can I distinct them before pass to auto_complete_for? I
afraid the performance would be affected if not to distinct it.
Thank you very much.
Valentino