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


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.

on 2008-11-21 12:50
(Received via mailing list)
try this:

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