title: Add search for name, email and date in ruby on rails
body: <p>How can I add search in a single field for name, email and created_at.</p>
  
  <p>Without search my query is as: </p>
  
  <pre><code>@messages = Message.joins(:user).select('messages.*, users.name').order('created_at desc').paginate(:page =&gt; params[:page], :per_page =&gt; 5)
  </code></pre>
  
  <p>For the search field my UI is as: </p>
  
  <pre><code>  &lt;%= form_for :message, :url =&gt; track_emails_path , :html =&gt; {:method =&gt; :get} do |f| -%&gt;
      &lt;div class="ic-Input-group"&gt;
        &lt;input class="ic-Input" type="text" id="user_name" name="user[search]" aria-labelledby="user_name_label" placeholder= "Search by name,email, date"/&gt;
        &lt;button class='Button'&gt;&lt;%= t 'buttons.go', "Go" %&gt;&lt;/button&gt;
      &lt;/div&gt;
    &lt;% end -%&gt;
  </code></pre>
  
  <p>I am able to get the searched result in my params. e.g., If I search for sneh then my params are like: <code>Parameters: {"utf8"=&gt;"✓", "user"=&gt;{"search"=&gt;"sneh"}}</code>. But I am not getting how to apply where condition in my query for all the three fields: name, email and created_at.</p>