hie,
i have 1 model area have column "location" having 1 word of specific area
now want compare location params may contain more 1 words.
e.g
value of location column "kerala" , params value "malappuram, kerala, india"
so how can fire query in rails??
try this:
params = "malappuram, kerala, india" area.where(:location => params.split(',')) # params.split(',') = ["malappuram", "kerala", "india"]
Comments
Post a Comment