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:
<h1>Musician Selection</h1>
<% 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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---