Advertisements

ror find usage

Postby sijo » Fri Jan 11, 2008 3:58 am

Offline
sijo
Posts: 4
Joined: Fri Jan 11, 2008 3:53 am
Can anybody tell how to use like operator of sql with find in rubyonrails

My problem
@firstname=@search_contact_hash[:name_first]
@search_contact_result=Contact.find(:all,:conditions => ["name_first like '%@firstname%'"])

it is not working.How can I make it working?

find

Postby sijo » Thu Feb 07, 2008 3:50 am

Offline
sijo
Posts: 4
Joined: Fri Jan 11, 2008 3:53 am
Hi

Thanks for ur reply.Sorry for my very late reply..I used find_where instead of find.A pluggin EZ-where.

Thanks & regards
Sijo