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 Example
Date:   2006-02-17 03:01:04
From:   vadhavane_anil
Hi,
I tried that live search example.
I want to select data from database based on that search text.
Means suppose entered text is y then i want results from database start with y.
i made it.
but when i use like query it shows error.
Query is:
@a=@params[:searchtext]


@links = Link.find_by_sql [
"SELECT * from links where link like '"+ @a +"%' order by id asc"]


1 to 2 of 2
  1. Live Search Example
    2006-04-19 02:09:52  a_shev [View]

  2. Curt Hibbs photo Live Search Example
    2006-02-17 03:33:36  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

1 to 2 of 2