On Jun 27, 2007, at 7:30 AM, Neil Hoyne wrote:
> I''ve been researching some of the functionality for the
autocompletion
> function that comes with RoR and is built around Scriptaculous.
>
> The only question I have is if this feature can be applied to a custom
> find request or can it only search through an entire table?
Taking the example from the Agile, the contract for
<%= text_field_with_auto_complete :user, :language %>
is that the controller responds to
auto_complete_for_user_language
and returns a UL whose LIs are the suggested completions. In the
action you can do whatever you want get the list of completions. The
class method auto_complete_for is just a generator, it generates a
method with that name and some default code.
There are even more flexible solutions, but I guess that''s enough for
what you needed.
-- fxn
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---