title: How to add an onchange event to select tag in rails
body: <p>How do I add an onchange event here?</p>
  
  <p>Framework: rails<br>
  Database: MySQL</p>
  
  <p>I am populating the options from the database and that made me use <code>options_from_collection_for_select</code></p>
  
  <pre><code>select_tag(:variable,options_from_collection_for_select(:all, :id, :name))
  </code></pre>