Re: Dynamic finds

Phil Tayo
Mon, 28 Jan 2008 20:38:39 -0000

the.masch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> HI!
> Is there any posibility to make a dynamic find that search with
"like"
> sentense?
> For example:
> In my table there are records with values: Disc 0, Disc 1, Disc 2,
> Disc 3, etc... and i want to search all the records with Disc string.
> It''s possible to do this?
>
>
> Salu2...

i''m not really sure what you want, does this help:

@disc = Disc.find(:all, :conditions=>["DISC LKE ?", disc_string])

http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001376
--
Posted via http://www.ruby-forum.com/.