title: Running a rails RJS template from a jquery get request
body: <p>I am using Rails and jquery with RJS templates to perform various AJAX requests.</p>
  
  <p>For most of my Ajax stuff I attach a submit handler to the form in my application.js as follows:</p>
  
  <pre><code>$('#tagging_flickr_photos').submitWithAjax();
  $('#tag_submit').click(function() {
      $('#flickr-photos-status').show();
  
  });
  </code></pre>
  
  <p>This calls the form action which does some processing and then forwards to a RJS template as follows:</p>
  
  <pre><code>$("#flickr-photos-status").hide();
  $("#flickr-photos").fadeIn();
  $("#flickr-photos").html("&lt;%= escape_javascript(render(:partial =&gt; 'flickr_photos_for_tagging_content')) %&gt;");
  </code></pre>
  
  <p>This works a treat.</p>
  
  <p>Now I am trying to do the same but just based on selecting a different value in a dropdown and not submitting a form.
  Here's my javascript to attach the handler to the dropdown:</p>
  
  <pre><code>$('#film_film_name_id').change(function() {
      $.get('/admin_film/make_tags?film_name_id=' + $("#film_film_name_id").val() + '&amp;film_speed_id=' + $("#film_film_speed_id").val());
  });
  </code></pre>
  
  <p>My controller method does some processing then forwards to the RJS template (make_tags.js.erb):</p>
  
  <pre><code>$("#film_tags").val(&lt;%=@tags%&gt;)
  </code></pre>
  
  <p>However, the template doesn't appear to execute.
  I can see entries in my logs that it's calling my method and rendering the template but no matter what I put in the template nothing seems to happen.
  I've put a Javascript alert in there and it doesn't fire.</p>
  
  <p>I assume the problem is to do with attaching my Javascript handler but I can't figure out what I am missing.  </p>
  
  <p>Thanks in advance for any help.</p>