title: Updating Rails Params with Javascript
body: <p>Is it possible to change the value in the Params hash when a Javascript function is called?
  I have a hidden Div, say DIV1 that becomes visible based on the selected value in a select field, within DIV1, I have a readonly textfield whose value is set to a value returned by a helper method. </p>
  
  <p>This helper method uses a dynamic find_by that depends on the value of Params,but I guess the param Hash doesn't change when the value of the select Changes (since it isn't a full page refresh?).  Please, how do I Achieve updating this so that when the select Value changes, the new value is reflected in the params hash. I have :remote=>true in the form_for tag.  Is there a better approach than mine? </p>
  
  <p>The Select field in a rails view </p>
  
  <pre><code>#finance_year
  &lt;%=f.select :financeyear, options_for_select(finance_year),{ :include_blank =&gt; 'Select a
  Financial Year' } %&gt;
  </code></pre>
  
  <p>and a an onchange event for that select </p>
  
  <pre><code>jQuery -&gt;
  $('#finance').hide()
  value = "Select a Financial Year"
  $('#finance_financeyear').change -&gt;
  selected = $('#finance_financeyear :selected').text()
  $('#finance').show()
  $('#finance').hide() if selected is value
  </code></pre>
  
  <p>the helper Method</p>
  
  <pre><code>def amount_owed(student)
  financeyear = params[:financeyear]
  @thisstudent = Finance.find_last_by_user_id(@student.user_id,
  :conditions =&gt; {:financeyear =&gt; financeyear } )
  if(@thisstudent)
    @amount_owed= @thisstudent.amount_owed
  else
    student.department.amount
  end
  end
  </code></pre>
  
  <p>I appreciate any help and I hope I've been able to ask the question intelligently. </p>