title: Rails - execute an ajax call via select dropdown menu
body: <p>I have a view that contains a <code>select</code> tag, it is not part of a form just a stand alone drop down menu. On clicking one of the options I want to execute an ajax call</p>
  
  <p>This is the select tag</p>
  
  <pre><code>&lt;%= select_tag 'application_stage', options_for_select(application.job.hiring_procedure.hiring_procedure_stages.map{ |p| [p.name, p.id] }), prompt: "Hiring stage", class: 'input-block-level chzn-select hiring_stage_dropdown', id: 'hiring_stage_dropdown' %&gt;
  </code></pre>
  
  <p>and this is a basic jquery through which I am trying to detect the change </p>
  
  <pre><code>    jQuery(function($) {
          console.log('clicked');
          $("#hiring_stage_dropdown").click(function() {
              var state = $('select#hiring_stage_dropdown :selected').val();
              console.log(state);
          });
      })
  </code></pre>
  
  <p>But when i select one of the options nothing happens, I know the ajax code is not there but all i want for now is to see something in console when one of the options is selected.</p>
  
  <p>What am i missing here?</p>
  
  <p>This is what the select looks like</p>
  
  <pre><code>&lt;select class="input-block-level chzn-select hiring_stage_dropdown" id="hiring_stage_dropdown" name="application_stage"&gt;
    &lt;option value=""&gt;Hiring stage&lt;/option&gt;
    &lt;option value="3"&gt;Manager Step 1&lt;/option&gt;
    &lt;option value="4"&gt;Manager Step 2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>