title: Form tag not routing correctly on Rails5
body: <h2>What I wanted to do:</h2>
  
  <p>Implementing search form on rails.
  If a user clicks the search button, rails will read the value from the text-input and pass it as a query.
  When I click the button, it should go to <strong>localhost/internships/search/keyword?keyword=blahblah</strong></p>
  
  <h2>What goes wrong</h2>
  
  <p>But whenever I click the button, it goes to <strong>localhost?keyword=blahblah</strong></p>
  
  <h2>What I did:</h2>
  
  <p>Here is my code</p>
  
  <h3>search_controller.rb</h3>
  
  <pre><code>&lt;div class="input-group"&gt;
      &lt;%= form_tag internships_keyword_search_path, method: :get do %&gt;
          &lt;%= text_field_tag :keyword, params[:keyword], placeholder: "Search query", class: "form-control" %&gt;
          &lt;%= submit_tag "search", name: nil, class: "btn btn-danger wrn-btn" } %&gt;
      &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h3>routes.rb</h3>
  
  <pre><code>get '/internships/search/keyword', to: 'internships_search#search_keyword', as: 'internships_keyword_search'
  </code></pre>
  
  <h2>Update</h2>
  
  <h3>1. Content of search_keyword</h3>
  
  <pre><code>def search_keyword
          @internships = Internship.where("subject LIKE :keyword OR content LIKE :keyword", keyword: params[:keyword]).all
          if @internships.length == 0 then
              render :empty
          else
              render :show
          end
  end
  </code></pre>
  
  <h3>2. When I change form_tag to link_to, it's working. But button_to isn't.</h3>
  
  <h3>3. nginx configuration</h3>
  
  <pre><code>upstream rails_app {
    server app:3000;
  }
  
  server {
    # define your domain
    server_name www.example.com;
  
    # define the public application root
    root   $RAILS_ROOT/public;
    index  index.html;
  
    # define where Nginx should write its logs
    # access_log $RAILS_ROOT/nginx.access.log;
    # error_log $RAILS_ROOT/nginx.error.log;
  
    # deny requests for files that should never be accessed
    location ~ /\. {
      deny all;
    }
  
    location ~* ^.+\.(rb|log)$ {
      deny all;
    }
  
    # serve static (compiled) assets directly if they exist (for rails production)
    location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ {
      try_files $uri @rails;
  
      access_log off;
      gzip_static on; # to serve pre-gzipped version
  
      expires max;
      add_header Cache-Control public;
  
      # Some browsers still send conditional-GET requests if there's a
      # Last-Modified header or an ETag header even if they haven't
      # reached the expiry date sent in the Expires header.
      add_header Last-Modified "";
      add_header ETag "";
      break;
    }
  
    # send non-static file requests to the app server
    location / {
      try_files $uri @rails;
    }
  
    location @rails {
      proxy_set_header  X-Real-IP  $remote_addr;
      proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
      proxy_pass http://rails_app;
    }
  }
  </code></pre>