title: Use selected item id from selected_tag in rails
body: <p><strong>view:</strong></p>
  <pre><code>&lt;%= select_tag 'template_id', options_from_collection_for_select(@templates, &quot;id&quot;, &quot;title&quot;, @template.id), class: &quot;form-control&quot;, id: &quot;template_select&quot; %&gt;
  
  $('#template_select').on('change', function() {
     &lt;% sections = Section.where(is_template: true, template_id: selected_template_id ) %&gt;
  });
  </code></pre>
  <p>How can I use the selected item id from the tag in my sql query's <em>template_id</em>?</p>