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.
Gustav P. (Guest)
on 2005-11-24 21: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

removed_email_address@domain.invalid
Simon.Santoro (Guest)
on 2005-11-24 23:09
(Received via mailing list)
gustav paul wrote:
> removed_email_address@domain.invalid
>

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.