title: Rails Ajax partials passing form builder
body: <p>I am loading part of my form with ajax depending on the value of a dropdown as follows:</p>
  
  <pre><code>..form_partial.js.erb
  
   $('#custom_ajax').remove();
    &lt;% if @house == "Rent" %&gt;
     $('#rest_of_form').after('&lt;div id="custom_ajax"&gt;&lt;%= escape_javascript render('/houses/forms/rent') %&gt;&lt;/div&gt;');
   &lt;% else %&gt;
     $('#rest_of_form').after('&lt;div id="custom_ajax"&gt;&lt;%= escape_javascript render('/houses/forms/buy') %&gt;&lt;/div&gt;');
  &lt;% end %&gt;
  </code></pre>
  
  <p>It is called here...</p>
  
  <pre><code>.._form.html.erb
  &lt;%= form_for @house, :validate =&gt; true, :html =&gt; { :class =&gt; 'form-horizontal',:multipart =&gt; true } do |f| %&gt;
  
  ..........................................
  ..........................................
  
  &lt;div id = "rest_of_form"&gt;&lt;/div&gt;
  &lt;div id="custom_ajax"&gt;
  ..........................................
  ..........................................
  
  &lt;/div&gt;
  ..........................................
  ..........................................
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
    $('#house_listing_type').change(function() {
  
  
  $.ajax({ url: '/houses/' + this.value + '/form_partial' });
  
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I then can load in the files with that, and it works great the only problem being I need to pass the form builder to the partial as my _buy.html.erb looks like this</p>
  
  <pre><code>  &lt;div class="control-group"&gt;
      &lt;%= label :property_classification, "Property Classification", :class =&gt; "control-label" %&gt;
        &lt;div class="controls"&gt;
            &lt;div class="input-prepend"&gt;
          &lt;span class="add-on"&gt;&lt;i class="icon-info-sign"&gt;&lt;/i&gt;&lt;/span&gt;
            &lt;%= select :property_classification, ["Residential","Commercial"], {},{:class=&gt;"input-medium"} %&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Which obviously needs the form builder, I have tried passing it through as a local etc. but to no avail. I have also attempted removing all the "f." this works, but the form is not displayed correctly, and none of the fancier form builder elements work..</p>
  
  <p>How can I get the form builder to the partial?</p>
  
  <p>Thanks</p>