I want a search field to start outputting results once a user statrs typing
Here is what I got so far
<%= observe_field 'keyword', :frequency => 0.5,
:update => 'results',
:loading => "Element.show('spinner')",
:complete => "Element.hide('spinner')",
:url => { :action=> 'search_results' } %>
then in my controller this is what i got. The text field is within a form i dont know if that makes a difference.
def search_results
keyword = params[:keyword]
@tutors = Tutors.find(:all,:conditions => ["category LIKE ?", '%' + keyword + '%'])
end