title: I am new on rails i not sure what is going on my code but I want to filter data from database by searching using id how can i do it
body: <p>I am trying generate a code that tracks for documents that revolve within the organisation. I have done other codes for adding employees, adding document types and logging in now I am struggling on creating a document form and search from the document that I have created. This code is for searching:</p>
  
  <pre><code>controller#show  
      def show
          @generate_documents = GenerateDocument.where('Reciever LIKE?',"%#{params[:search]}%")
          # @generate_documents = GenerateDocument.all
        end
  
  views/show
      &lt;%= form_tag generate_document_path, :method =&gt; :get do %&gt;
      &lt;p&gt;
        &lt;%= text_field_tag :search, params[:search] %&gt;
        &lt;%= submit_tag "Search" %&gt;
      &lt;/p&gt;
      &lt;% end %&gt;
      &lt;!-- end of seaerch form --&gt;
  
  
      &lt;!-- loading data from database and displaying then in a list format BEGIN --&gt;
      &lt;ul&gt; 
        &lt;% @generate_documents.each do |generate_document| %&gt;
        &lt;li&gt;
  
  
           &lt;%= link_to generate_document.Reciever, edit_generate_document_path(generate_document) %&gt;
            &lt;/li&gt;
        &lt;% end %&gt;`enter code here`
      &lt;/ul&gt;
      &lt;!-- 
      END LISTING --&gt;
  
      &lt;%= link_to 'New Generate Document', new_generate_document_path %&gt;
  </code></pre>