title: Problem passing params from view to controller in Ruby On Rails
body: <p>I am new to ROR and am trying to pass two variables from two fields in a view to a controller to generate a dataset for an excel export.  The excel export works, however all I get are headers and no data.  I know it's because the parameters aren't being passed to the controller.</p>
  
  <p>Here's the code.  The SQL has been shortened...
  <strong><em>In View</em></strong></p>
  
  <p></p>
  
  <pre><code>    &lt;table border="0" cellspacing="0" cellpadding="10"&gt;
        &lt;tr&gt;
          &lt;td style="text-align: left; width:400px;"&gt; Enter any part of a BU Manager Name, Subcontractor name, Subcontractor ID, PO Number, CRN or SCA name:&lt;/td&gt;
          &lt;td style="text-align: left;"&gt;
            &lt;% form_tag  :controller =&gt; 'subcontracts', :action =&gt; 'show_active_subcontracts_results', :method =&gt; 'get' do %&gt;
              &lt;p&gt;
                &lt;%= text_field_tag :search, params[:search] , :id =&gt; 'search_field' %&gt;
              &lt;/p&gt;
          &lt;td&gt;
              &lt;p&gt;
                Expand Contract Period:
                &lt;%=  select_tag 'c_end_date', options_for_select([["Current Subcontracts", "1"],["Past 5 Years", "2"], ["All", "3"]],{:mutiple =&gt; false}) %&gt;
                &lt;%= submit_tag "Update", :name =&gt; nil %&gt;
                &lt;%= link_to_function "Clear", "$('search_field').clear()" %&gt;
                &lt;%= link_to 'Export To Excel',:action=&gt;'active_subcontracts_to_excel',  :format=&gt; 'excel'  %&gt;
  
                &lt;/p&gt;
          &lt;/td&gt;
            &lt;% end %&gt;
          &lt;/td&gt;            
        &lt;/tr&gt;          
      &lt;/table&gt;
  </code></pre>
  
  <p>What I want to do is pass the 'c_end_date' and 'search' data to the controller.  Not sure if the link_to is the correct way.</p>
  
  <p>Thank you for your help.</p>