Having trouble when I try to add a second condition to find. I''ve
tried search and referencing
http://api.rubyonrails.org/classes/ActiveRecord/Base.html,
but not seeing a clear answer on my syntax.
Working code:
def cc_class_six
@products = Product.find(:all, :conditions =>[''store LIKE
?'', ''%'' +
''class'' +''%''])
return @products
end
Code where I''ve added a second condition to find by that returns
syntax errors:
def cc_class_six
@products = Product.find(:all, :conditions =>[''store LIKE
?'', ''%'' +
''class'' +''%''] and
["city=''corpus christi'' "])
return @products
end
I''ve tried several variations, but all return syntax errors:
:conditions =>[''store LIKE ?'', ''%'' +
''class'' +''%'' and "city=''corpus
christi'' "])
:conditions =>[''store LIKE ?'', ''%'' +
''class'' +''%'' and
''city=''corpus
christi'' ''])
:conditions =>[''store LIKE ?'', ''%'' +
''class'' +''%''] and
[''city=''corpus
christi'' ''])
Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---