I'm using a layout for the landing area of my site, and on that I'm using the devise\_controller? method to add #login & .span.offset4 that tell the Devise views to move to the middle and set a background color.

```
%body
  = render :partial => "landing/landingmenu" 
  - if devise_controller?
    #login
      .span4.offset4  
        = yield
  - else
    = yield
  = render :partial => "landing/footer"

```

And this outputs with the footer partial inside the #login div, instead of outside it: 

```
<body>
  <div id="login">
    <div class="span4 offset4">...</div>
    <div class="footer">...</div>
  </div>
</body>

```

I've tried putting the footer partial up inside the if like this and get the same incorrectly nested HTML output:

```
%body
  = render :partial => "landing/landingmenu" 
  - if devise_controller?
    #login
      .span4.offset4  
        = yield
    = render :partial => "landing/footer" 
  - else
    = yield
    = render :partial => "landing/footer" 

```

Any ideas would be much appreciated!