Rails - Find Condition of two model fields -


I am trying to find results of a model where it inquires as a result of two situations

I have a search tag that

  Model.find (: all,: conditions => parameter like "Name [search]")  

But I want to find all the records for the search where the parameter like [search] or description is the name of the [search] name.

Is there a way or someone Adding to the condition in the rail?

Should I make a statement?

rail For 2.x, you can use this query, which is a SQL injection The attacks are not weak:

  Model.all (: conditions => ["Like the name? Or as the description?", "% # {          / div>  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -