title: Searching multiple columns in a text_field_tag
body: <p>3.5 and ruby 1.8.7 
  I'm trying to create a multiple search working with 4 columns (name,name2,last_name,last_name2), want to search in a text box my 4 columns but i don't want to create 24 conditions, is there any other way to do this or maybe creating a conditional FOR instead of 24 conditions</p>
  
  <pre><code>I want to search by
      name and name2
      name and name2 and last_name
      name and last_name
      last_name and last_name2
   ...
   There are 24 conditions
  </code></pre>
  
  <p>Actually my controller is working but i don't want to write 24 conditions , here is my problem</p>
  
  <p>Here is my model is empty</p>
  
  <pre><code>  ****************Here is my model************
  
   class Project &lt; ActiveRecord::Base
  
   end
  </code></pre>
  
  <p>Here is my controller</p>
  
  <pre><code>*************Here is my controller****************
  
  class ProjectsController &lt; ApplicationController
     def index
         @projects = Project.find(:all, :conditions =&gt; "(
                                       name LIKE \"#{params[:query]}%\" OR 
                                      name2 LIKE \"#{params[:query]}%\" OR 
                                  last_name LIKE \"#{params[:query]}%\" OR  
                                 last_name2 LIKE \"#{params[:query]}%\" OR
            (concat(name, \" \", last_name) LIKE \"#{params[:query]}%\")OR
            (concat(name, \" \", name2    ) LIKE \"#{params[:query]}%\")OR
      (concat(last_name, \" \", last_name2) LIKE \"#{params[:query]}%\")OR
      (concat(name, \" \", name2, \" \",last_name, \" \",last_name2) LIKE \"#{params[:query]}%\")OR
     (concat(name, \" \", name2, \" \",last_name) LIKE \"#{params[:query]}%\"))  ")
      end
  end
  </code></pre>
  
  <p>Here is search form</p>
  
  <pre><code>*********************Here is my view
  
  &lt;div id="search-area"&gt;
    &lt;div id="searchbox"&gt;
       &lt;form name="search-form" id="search-form"&gt;
         &lt;label for="query"&gt;&lt;%= ('BUSCAR') %&gt;
          &lt;%= image_tag("loader.gif",
                       :align =&gt; "absmiddle",
                       :border =&gt; 0,
                       :id =&gt; "loader",
                       :style =&gt;"display: none;" ) %&gt;
        &lt;/label&gt;
          &lt;%= text_field_tag "query", params[:query], :autocomplete =&gt; 'on' %&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Someone can help me to convert this in a conditional for? or maybe other way to find 4 columns in a text_field_tag</p>