ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Ajax on Rails
Subject:   Live Search
Date:   2006-11-20 09:51:22
From:   Calleja
Hi, im trying Live Search, in my template:
Live Search: <input type="text" name="texto" />
<%= observe_field( :texto,
:frequency => 0.25,
:update => "search_hits",
:with => "texto",
:url => { :action => :resultados })%>
<div id="search_hits"></div>


In my controller, can I do this?:
def resultados
live=@params[:texto]
@nombres=Receta.find_all["titulo=?",live]
@nombres.each do |nom|
render_text nom.titulo
end
end


Appears me an error: cannot convert String into Integer
How can i to read @nombres? Thanks