# Trying to remove HTML layout from RXML templates

**URL:** <https://www.ruby-forum.com/t/trying-to-remove-html-layout-from-rxml-templates/125119>\
**Category:** Rails\
**Created:** [January 5, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/trying-to-remove-html-layout-from-rxml-templates/125119 "2008-01-05T19:55:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [January 5, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/trying-to-remove-html-layout-from-rxml-templates/125119/1 "2008-01-05T19:55:58Z")

</div>

Hi you all,

I have a simple REST app with a controller method like this:  
def index  
@sdrs = Sdr.find(:all)  
respond\_to do |format|  
format.html  
format.xml  
end  
end

The rxml is well constructed, however, what I get when the request is  
through XML is the xml information surrounded by the layout of the app,  
something like:

- 
- Sdrs: index
- \<?xml version="1.0" encoding="UTF-8" ?\>

- 
- 693710000 62238000

How can I say that I just want the xml output?

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [January 6, 2008, 8:16pm UTC](https://www.ruby-forum.com/t/trying-to-remove-html-layout-from-rxml-templates/125119/2 "2008-01-06T20:16:06Z")

</div>

Either this:  
layout ‘application’, :except =\> :create\_with\_ajax  
or this:  
[http://dev.rubyonrails.org/ticket/7682](http://dev.rubyonrails.org/ticket/7682) (some code is in the middle of  
the page)

-Christoph

On Jan 5, 7:55ï¿½pm, Damaris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [January 6, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/trying-to-remove-html-layout-from-rxml-templates/125119/3 "2008-01-06T20:47:52Z")

</div>

Thanks!  
I’ve read the ticket and I’ve used the  
exempt\_from\_layout :rxml  
in my controller.

Thanks.

Kitto wrote:

> Either this:  
> layout ‘application’, :except =\> :create\_with\_ajax  
> or this:  
> [http://dev.rubyonrails.org/ticket/7682](http://dev.rubyonrails.org/ticket/7682) (some code is in the middle of  
> the page)
> 
> -Christoph
> 
> On Jan 5, 7:55ï¿½pm, Damaris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
