Hi, I am trying to use text_field_with_auto_complete, it works fine but when I click on an item (even if I use the up and down key and then type enter) th search panel disappears but the selected results is not shown in the text field. Even more, the text field becomes empty. Any idea? Thanks S?bastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060120/9850ae15/attachment.html
Hi Sebastien ~ What does your view look like? ~ What does your Controller method have to handle the request? ~ What browser are you working in? Right now it is tough to offer a reason why this isn''t working without some more information. ~ Ben On 1/20/06, S?bastien Gruhier <seb@itseb.com> wrote:> > Hi, > I am trying to use text_field_with_auto_complete, it works fine but when I > click on an item (even if I use the up and down key and then type enter) th > search panel disappears but the selected results is not shown in the text > field. Even more, the text field becomes empty. > > Any idea? > > Thanks > > S?bastien > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Ben Reubenstein http://www.benr75.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060120/7a3071cd/attachment.html
Sorry, I was not very precise I am on Max OS X - Safari It''s a simple search for people using their lastname. What will be perfect is when I click on a name from the result list, I go to the update page. ** view <%= text_field_with_auto_complete :search, :name, { :auto_complete => "off" }, :skip_style => true %> ** controller def auto_complete_for_search_name search = params[:search][:name] @citizens = Citizen.find( :all, :conditions => [ ''LOWER(lastname) LIKE ?'',''%'' + search.downcase + ''%'' ], :order => ''lastname ASC'', :limit => 15) render :partial => ''found'' end ** partial html <ul class="search"> <% for citizen in @citizens.to_a -%> <li class="search"> <div class="name"><%=h citizen.lastname %></div> </li> <% end -%> </ul> Thanks S?bastien Le 20 janv. 06 ? 19:03, Ben Reubenstien a ?crit :> Hi Sebastien ~ > > What does your view look like? ~ What does your Controller method > have to handle the request? ~ What browser are you working in? > > Right now it is tough to offer a reason why this isn''t working > without some more information. > > ~ Ben > > On 1/20/06, S?bastien Gruhier <seb@itseb.com> wrote: > Hi, > > I am trying to use text_field_with_auto_complete, it works fine but > when I click on an item (even if I use the up and down key and then > type enter) th search panel disappears but the selected results is > not shown in the text field. Even more, the text field becomes empty. > > Any idea? > > Thanks > > S?bastien > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > Ben Reubenstein > http://www.benr75.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060120/de6759ca/attachment.html
hi Sebastien, I am having the exact same problem. Where you able to figure this one out? Thanks, Cagan S?bastien Gruhier wrote:> Sorry, I was not very precise > > I am on Max OS X - Safari > It''s a simple search for people using their lastname. What will be > perfect is when I click on a name from the result list, I go to the > update page. > > > ** view > <%= text_field_with_auto_complete :search, :name, { :auto_complete => > "off" }, :skip_style => true %> > > ** controller > def auto_complete_for_search_name > search = params[:search][:name] > @citizens = Citizen.find( :all, :conditions => [ ''LOWER(lastname) > LIKE ?'',''%'' + search.downcase + ''%'' ], :order => ''lastname > ASC'', :limit => 15) > render :partial => ''found'' > end > > ** partial html > <ul class="search"> > <% for citizen in @citizens.to_a -%> > <li class="search"> > <div class="name"><%=h citizen.lastname %></div> > </li> > <% end -%> > </ul> > > > Thanks > S?bastien > > Le 20 janv. 06 ? 19:03, Ben Reubenstien a ?crit :-- Posted via http://www.ruby-forum.com/.