Forum: Ruby on Rails Autocompleting combobox: fact or fiction?

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.
Ffc38459818ed3e1182553d45e6f2479?d=identicon&s=25 Gustav Paul (s04015)
on 2005-11-24 20:58
Hey,

I've got a script.aculo.us autocompleting textfield that works
wonderfully, but how do I make the value of the selected option submit
with the form...for that matter, do autocompleting textboxes have
'option' tags, or is what I want to do simply impossible 8[

Thanks,
Gustav

gustav@psychohistorian.org
B6e90ad1e69d563f1f13cccffe137262?d=identicon&s=25 Simon.Santoro (Guest)
on 2005-11-24 22:09
(Received via mailing list)
gustav paul wrote:
> gustav@psychohistorian.org
>

view:
<%= start_form_tag :action => 'list' %>
Title: <%= text_field_with_auto_complete :movie, :title %>
<%= submit_tag 'Search' %>
<%= end_form_tag %>


controller:
auto_complete_for :movie, :title

def list
   @movies =  Movie.find(:all, :conditions => ["title like ?", "%" +
unless params[:movie] then "" else params[:movie]["title"] end + "%"],
:order => "title")
   @categories = Category.find(:all)
end


works fine for me
This topic is locked and can not be replied to.