# Render html partial from atom builder

**URL:** <https://www.ruby-forum.com/t/render-html-partial-from-atom-builder/188881>\
**Category:** Rails\
**Created:** [May 19, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/render-html-partial-from-atom-builder/188881 "2010-05-19T21:31:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [May 19, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/render-html-partial-from-atom-builder/188881/1 "2010-05-19T21:31:20Z")

</div>

So I have an action that results in atom:

def index  
…  
respond\_to do |format|  
…  
format.atom { render :layout =\> false}  
end  
end

Then I have a builder template to render the atom, called  
index.atom.builder.

Inside this builder template, I’d like to render one of my existing html  
partials, to put in the atom:content element, perfectly normal atom  
thing to do.

xml.content :type =\> “text/html” do  
xml.text! render(:partial =\> “my\_thing”)  
end

The problem is that the template for my\_thing is my\_thing.html.erb. And  
since we’re somehow in an xml ‘context’, the render call doesn’t find  
it, it complains that no template could be found.

If I change it to render(:partial =\> “my\_thing.html.erb”), it works…  
sort of. Because it turns out THAT partial calls OTHER partials, and all  
of THOSE partial calls would also need to have “.html.erb” added to  
them.

This is getting messy. Is there some better way to take care of this  
that involves sweet-talking Rails instead of fighting with it?
