title: custom validation markup in Rails(3)
body: <p>I'm trying to accomplish the following mark-up for all my form elements</p>
  
  <pre><code>&lt;div class="input-container"&gt;
    &lt;label&gt;Topic Title&lt;/label&gt;
    &lt;div class="input-holder"&gt;
      &lt;input type="text" /&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="textarea-container"&gt;
    &lt;label&gt;Post&lt;/label&gt;
    &lt;div class="textarea-holder"&gt;
      &lt;textarea&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>invalid fields mark-up:</p>
  
  <pre><code>&lt;div class="input-container alert"&gt;
    &lt;label&gt;Topic Title&lt;/label&gt;
    &lt;div class="input-holder"&gt;
      &lt;input type="text" /&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="textarea-container alert"&gt;
    &lt;label&gt;Post&lt;/label&gt;
    &lt;div class="textarea-holder"&gt;
      &lt;textarea&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>here's my current haml markup:</p>
  
  <pre><code>.input-container
    = f.label :title, 'Topic Title'
    .input-holder
      = f.text_field :title
  .textarea-container
    = f.label :body, 'Post'
    .textarea-holder
      = f.text_area(:body, :size =&gt; "60x10")
  </code></pre>
  
  <p>Now what would I need to do if I want the container divs to have the alert class when a field in my form is invalid?</p>