How to write a condition statement in a method findor paginateso that users can search for names Projectand at the same time Project Category?
Now my code is as follows:
@projects = Project.paginate :per_page => 20, :page => params[:page], :conditions => ['name LIKE ?', "%#{params[:search]}%"]
So, I also have a table Categorywith a field name. How to combine these two nametogether in this search query?
source
share