title: ActionController::UrlGenerationError in Univ#index
body: <p>I tried to list out the values of a specific table in the database using the following view file</p>
  
  <p>index.html.erb</p>
  
  <pre><code>&lt;%= form_tag univ_path, method: :get do %&gt;
    &lt;p&gt;
      &lt;%= text_field_tag :query, params[:query] %&gt;
      &lt;%= submit_tag "Search", name: nil %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  
  
  &lt;h1&gt;List of Universities based on ranking&lt;/h1&gt;
  &lt;div id="articles"&gt;
    &lt;% @univ.each do |univ| %&gt;
      &lt;h2&gt;
        &lt;%= link_to univ.univ_name, univ %&gt;
      &lt;/h2&gt;
      &lt;div class="info"&gt;
        &lt;b&gt;Location:&lt;/b&gt; &lt;%= univ.location %&gt;, &lt;%= univ.state %&gt; &lt;br/&gt;
      &lt;/div&gt;
      &lt;br /&gt;&lt;br /&gt;
  
      &lt;div class="content"&gt;&lt;p&gt;&lt;%= univ.description %&gt;&lt;p&gt;&lt;/div&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and the controller file is as follows</p>
  
  <p>univ_controller.rb</p>
  
  <pre><code>class UnivController &lt; ApplicationController
  
    def index
      if params[:query].present?      
        @univ= Univ.search(params[:query])
      else
        @univ=Univ.all
      end
    end
  
    def show
      @univ= Univ.find(params[:id])
    end
  
    def register
      @univ = Univ.new(params[:univ])
      if(request.post? and @univ.save)
        flash[:notice]= "Account Created Successfully"
        redirect_to :controller =&gt; 'univ', :action =&gt; 'register'
      end
    end
  end
  </code></pre>
  
  <p>I was able to list out the contents of the table from db. However, when I include the form_tag for implementing search it results an error</p>
  
  <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"univ"} missing required keys: [:id]
  </code></pre>
  
  <p>my routes.rb has</p>
  
  <pre><code>resources :univ get 'search' =&gt; "univ#index", :as =&gt; "search"
  </code></pre>
  
  <p>Please suggest necessary changes</p>