Forum: Ruby on Rails Question about auto completion field

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Af3cecc8af253b5acd3c09c5b67c0074?d=identicon&s=25 Valentino Lun (on9west)
on 2008-11-21 02:52
Dear all

I am reading a rails cookbook about the auto_complete_for function, the
code as below


class MusiciansController < ApplicationController

  auto_complete_for :musician, :name

  def index

  def add
    # assemble a band...


<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.

062a74ced8ceb9c7706cd73ec93c5bcf?d=identicon&s=25 (Guest)
on 2008-11-21 11:50
(Received via mailing list)
try this:

On 20 nov, 23:52, Valentino Lun <>
This topic is locked and can not be replied to.