Forum: Ruby on Rails Question about auto completion field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Valentino L. (Guest)
on 2008-11-21 03:52
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
(Guest)
on 2008-11-21 12:50
(Received via mailing list)
try this:

http://wiki.rubyonrails.org/rails/pages/How+to+use...

On 20 nov, 23:52, Valentino L. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.