title: Rails/JS button onclick to re-render partial without entering into DB
body: <p>I wish to reload a partial-form with a button(Add). I'm new and don't know how to simply display fields in partial like listings one under the other as many times Add button is clicked. I can't find a relevant example. all AJAX examples mention js.erb when object is saved in DB.</p>
  
  <pre><code>&lt;div class="panel-body"&gt;
   &lt;%= render partial: "degrees/form", :locals =&gt; { :f =&gt; f }  %&gt; 
   &lt;%= f.link_to (fa_icon 'plus').to_s + " Add Another Qualification ", render(:partial =&gt; 'degrees/form', :locals =&gt; { :f =&gt; f }), class: "btn btn-primary" %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here, @application is the main form trying to display degree fields. Partial is simply two text-fields- one for selecting educational degree and second its detail.Here's partial</p>
  
  <pre><code> &lt;%= f.fields_for [Degree.new], :url =&gt; { :action =&gt; "index" } do |ff| %&gt;
    &lt;div class = "form-group" }&gt;
      &lt;%= ff.select :level, options_for_select(Job::EDUCATION, params[:level]), include_blank: "Select Degree", class: 'span-2' %&gt;
      &lt;%= ff.text_field :description, :class =&gt; 'span5' %&gt;
    &lt;/div&gt;
     &lt;% ff.submit "Add Another Degree", class: 'btn btn-primary' %&gt;
  </code></pre>