Re: [Rails] How to apply OR condition in model.find?

2010-09-09 Thread Fred Ballard
Hi, http://apidock.com/rails/v2.3.8/ActiveRecord/Base/find/class shows: mihserf - July 22, 20083 thanks :conditions examples :conditions => {:login => login, :password => password} :conditions => [‘subject LIKE :foo OR body LIKE :foo’, {:foo => ‘woah’}] (from the book "The Rails Way") On

Re: [Rails] How to apply OR condition in model.find?

2010-09-09 Thread PalaniKannan K
Dear Collin... Wooww... Excellent... Tanx @ extreme. I too tried with many examples obtained from online forums... This made me fun... On 9 September 2010 14:43, Colin Law wrote: > On 9 September 2010 12:32, PalaniKannan K wrote: > > Hi, > > > > @table_names = TableName.find(:all, :conditions=

Re: [Rails] How to apply OR condition in model.find?

2010-09-09 Thread Colin Law
On 9 September 2010 12:32, PalaniKannan K wrote: > Hi, > > @table_names = TableName.find(:all, :conditions=>{:column_name => > params[:gm], :column_id => params[:id]}) > > Here, I used two conditions to find SQL. This two conditions applies with > "AND". I need to apply this two conditions with "O

[Rails] How to apply OR condition in model.find?

2010-09-09 Thread PalaniKannan K
Hi, @table_names = TableName.find(:all, :conditions=>{:column_name => params[:gm], :column_id => params[:id]}) Here, I used two conditions to find SQL. This two conditions applies with "AND". I need to apply this two conditions with "OR" condition. Applying "|" or "||"symbol fails... How I can a