title: How to change my custom error html from rendering itself twice?
body: <p>When I try to create a category by using Ajax I get a strange behavior with my error message.</p>
  
  <p>Right now I have my error message appearing like this:</p>
  
  <p><img src="https://i.stack.imgur.com/1vAvx.png" alt="enter image description here"></p>
  
  <p>My create.js.erb and new.js.erb both have the same code which is just this line:</p>
  
  <pre><code>$(".cc-form").html("&lt;%= escape_javascript(render(:partial =&gt; 'categories/form', locals: { category: @category })) %&gt;");
  </code></pre>
  
  <p>This is my category form:</p>
  
  <pre><code>&lt;%= form_for(@category, :remote =&gt; true, :html =&gt; { :class =&gt; "add-form", :id =&gt; "cform" }) do |f| %&gt;
  &lt;fieldset&gt;
     &lt;p&gt;
        &lt;%= f.label :name, "Category Name *" %&gt;
        &lt;br /&gt;
        &lt;%= f.text_field :name %&gt;
     &lt;/p&gt;
     &lt;div class="form-actions"&gt;
       &lt;%= f.submit "Create" %&gt;
     &lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>Here is the code to enable custom error HTML:</p>
  
  <pre><code># application.rb
  
  ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
     errors = Array(instance.error_message).join(',')
     %(#{html_tag}&lt;span class="validation-error"&gt;&amp;nbsp;#{errors}&lt;/span&gt;).html_safe
  end
  </code></pre>
  
  <p>Then the HTML itself along with the error HTML:</p>
  
  <pre><code>&lt;p&gt;
    &lt;label for="category_name"&gt;Category Name *&lt;/label&gt;&lt;span class="validation-error"&gt;&amp;nbsp;can't be blank&lt;/span&gt;
    &lt;br&gt;
    &lt;input id="category_name" name="category[name]" size="30" type="text" value=""&gt;&lt;span class="validation-error"&gt;&amp;nbsp;can't be blank&lt;/span&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I only want the error message next to the <code>label</code> and not the right side of the <code>input</code>. How would I do this? The format is tricky for me when I look at it.</p>
  
  <p>Thanks.</p>