title: Ruby on Rails, how to structure this HAML code to not include some <div> at top level?
body: <p>if the HAML is:</p>
  
  <pre><code>.class1
    .class2
      .class3
        %div 
          content... many lines
  </code></pre>
  
  <p>How can it be made so that it doesn't respond with class1 and class2 if it is Ajax?</p>
  
  <pre><code>- if !request.xhr?
    .class1
      .class2
  
  .class3
    %div 
      content... many lines
  </code></pre>
  
  <p>won't work, because if not Ajax, then class3 is not a child of class2.  It might have to be something like</p>
  
  <pre><code>- if !request.xhr?
    .class1
      .class2
        .class3
          %div 
            content... many lines 
  - else
    .class3
      %div 
        content... many lines
  </code></pre>
  
  <p>and it is repeating a lot of code.  Can it be structure within the same file?  Or the second part made into a partial?</p>