Check the ActiveRecord docs, look for the find_by_sql method.
Somthing like
MODEL_CLASS.find_by_sql(["SELECT * FROM TABLENAME WHERE FIELD LIKE ?",
"%#{VALUE}%"])
On 2/17/06, ani vadhavane <vadhavane_anil@india.com>
wrote:>
> Hi,
>
> I want database query in rail for ''LIKE''
>
> i.e in sql it something like.
> "SELECT * FROM tablename where filedname LIKE
''%keyword%'' " etc.
>
> What for rail?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
-------------------------------
Jorge Sousa
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/93255add/attachment-0001.html