Dynamic finds

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…

[email protected] 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

Greate!!..Thanks so muchhh!! thats really work!..

Salu2…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs